-
Notifications
You must be signed in to change notification settings - Fork 32
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Metadata Editor: redirect to login URL if accessing the editor as anonymous user #1006
Conversation
Affected libs: ``,
|
}, | ||
], | ||
}, | ||
{ path: 'sign-in', component: SignInPageComponent }, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this route was removed as it was obviously not needed anyway
component: DashboardPageComponent, | ||
outlet: 'primary', | ||
path: '', | ||
canActivate: [AuthGuardService], | ||
children: [ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Adding a root route ( 🤔 ) makes it easier to apply the same guard to all routes
📷 Screenshots are here! |
it('redirects to the login page', () => { | ||
cy.url().should( | ||
'include', | ||
'/catalog.signin?redirect=http://localhost:4200/catalog/search' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Out of curiosity, where does this redirect
value come from? The referer? It's often needed to be redirected after successful login, but I don't see it written in our code.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for this improvement.
There is still one corner case when the authentication might fail, when the user is already wrongly connected (XSFR cookie set on the wrong path from the legacy UI), and the redirection is not activated then.
Otherwise, all good !
0bba5e3
to
c16c6bc
Compare
c16c6bc
to
c95043b
Compare
Description
This PR adds a common route guard for all routes in the ME app.
Also removed an unused component.
Architectural changes
none
Quality Assurance Checklist
breaking change
labelbackport <release branch>
label