Router authorizeStep from other app root keeps triggering - aurelia

My Aurelia project is split up in 2 app roots, both with their own route structure.
App root 1 contains all screens where you don't have to be authenticated (login, reset pwd,...) App root 2 all the other screens.
I'm blocking access to routes on app root 2 when you are not authenticated with an authorizeStep. In this step, I set the root to app root 1 when you are not authenticated. App root 1 has a login view as default route, so this works quite well. So, when you are not authenticated and try to navigate to a deep url in app root 2, this happens:
App Root 2 configures it's routes and tries to navigate to the deep url
The authorizeStep triggers, you are not authenticated, the route is cancelled and an aurelia.setRoot() happens to app root 1
App root 1 configures it's router and navigates you to the default route, the login page
The problem is manually logging out. When this button, residing in app root 2, is clicked. I clear user data, therefore you are not authenticated anymore. Following that step, I manually set the root to app root 1, and there I get an infinite loop:
App root 1 configures it's router and navigates you to the default route, the login page
The authorizeStep triggers from app root 2!, you are not authenticated, the route is cancelled and an aurelia.setRoot() happens to app root 1
App root 1 configures it's router and navigates you to the default route, the login page
...
The problem is that the authorizeStep from root 2 triggers when navigating in root 1. I looked for a way for removing the authorizestep, but I don't think the framework currently exposes this. I find it very curious that this issue only occurs when clicking logout, deep linking and redirecting to login works as expected.
I created a reproducable gist for clarity, click the logout button and you will see the console infinitely repeating the authorizestep.
https://gist.run/?id=1a551dcc4bec7d191ab680a937b19cfc

Turns out you need to clear the steps yourself, this isn't done in a router.clear(), which the aurelia.setRoot() internally calls.
Fortunately you actually can do this yourself, with:
this.pipelineProvider.reset();
I don't find this behavior logical though, so I created an issue for it: https://github.com/aurelia/router/issues/465

Related

__vite_ssr_import_1__.Client is not a constructor Error

I am developing a simple app to showcase CRUD operations with Appwrite and Nuxt 3 (Release Candidate 11). The source code to the same can be found here.
I am using the landing page of the app (index.vue) for simple redirection i.e. if the account exits in the accountStore, I want to redirect the user to /workouts route, else ask them to login by redirection to the /login route.
The problem I am facing is when I am landing on the index.vue page (with no user session in progress in Appwrite), I am still getting redirected to /workouts route, instead of the /login route. I presume the reason for the same is the following error that is being logged in the console.
I need help in figuring out from where is the error message originating and how to possibly remedy it.
Here is my public github repo: https://github.com/EshaanAgg/workout-buddy
Maybe this is a bug with Nuxt 3 or Vite since Nuxt 3 is currently only a release candidate.
Also, in my opinion, Server Side Rendering (SSR) always complicates things so much. It doesn't look like you're using SSR, so you could possibly update your nuxt.config.ts to disable SSR:
{
// ... other stuff
ssr: false
}

Laravel 8 - inertia-jetstream-fortify, redirect to a particular URL before login (i.e. On hit of main URL ex.-www.something.com)

I have a Single sign-in laravel application which is, say for example app-A. And my main application app-B. Now, whenever a user visits www.aap-B.com, I want the user to reach to the login page of app-A.
Since app-B is built using laravel fortify whenever I first hit the site url of app-B it takes me to the login page of app-b. How to edit this login route in laravel since it is coming from vendor/laravel/fortify folder. How to make app-B follow the first endpoint to direct to URL of app-A without going to the defult login route when we hit the URl of app-B for the first time.
I don't know where can I edit this login route in app-B. Any piece of advice would be of great help.

Redirect route after login using nuxt auth module

I use nuxt auth module when I route to a guard page when I don't log in the login page is open but if I don't log in and go to another page not guarded and login successfully, automatically redirect me to the last guarded page I was open before if there is any solution for that? I want to go to the last page I was open after login successfully

How to access a vue page from a link sent by email

I have an application in vue configured with vue router, and I have a component with a view to recover the password (recover-password), my problem is that when sending to a user the link of this component for example (https://example.com/recover-password) by mail, it always redirects me to my login page, and not to the recover password page. I don't know what I need to configure in my vue router so that I can access to the password recovery page from a external link or page. Thanks!!!
You need to make sure you add meta: {requiresGuest: true } to your recover-passowrd inside your router config.
Also make sure that any router-guard isn't preventing the redirect

How to regain Login Portlet in liferay

I am new to liferay 5.1 technology.
I by mistake removed the login portlet and now I am not able to login into the application.
I mean login portlet is no more visible any help would be of great help.
Can you please try hitting the following url?
localhost:8080/c/portal/login
Replace host and port with your host and port number.
If it doesnt work out try doing the following.(Make sure the package is correct as i am not aware of package path in 5.1)
http://www.liferay.com/community/forums/-/message_boards/message/5005621
Actually, with enough persistence, it would be also possible to lock yourself out of access to /c/portal/login (as of Liferay 6.0.6). This can be done by setting community home page to a hidden "redirect" page (as opposed to default "portlet" page), causing /c/portal/login to redirect wherever the home page redirects.
Liferay tries to prevent from doing so by issuing alerts whenever you try to make home page hidden. But you can make some page hidden and then drag&drop it to the first position in site map root level.
The reason behind doing so is to achieve a certain appearance of portal navigation (which would otherwise require some mangling in theme), i.e. make home page redirect to one of it's children.
Going back to the topic, when /c/portal/login fails, there is one another, more reliable (yet more ugly) method of getting to what one would call a login page - append this: ?p_p_id=58&p_p_state=maximized to any non-redirecting Liferay page (and probably drop any other GET parameters if existent). This is also basically what /c/portal/login does - but it appends it to home page, so if home page is a redirect page it fails display login portlet in it's maximized state.