Skip to content
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

change sso authentication success route to front page #804

Merged
1 commit merged into from
Jun 4, 2024

Conversation

CocoPoops
Copy link
Contributor

Changes the page which a sso user is redirected to when logged in to the front page so that it is the same as non sso users

@ghost
Copy link

ghost commented Jun 4, 2024

Good catch! Maybe we should make each of them do what the KbinAuthenticator.php onAuthenticationSuccess() method does for consistency?

public function onAuthenticationSuccess(Request $request, TokenInterface $token, string $firewallName): ?Response
{
if ($targetPath = $this->getTargetPath($request->getSession(), $firewallName)) {
return new RedirectResponse($targetPath);
} else {
return new RedirectResponse($this->urlGenerator->generate('front'));
}
}

Honestly I'm not sure why it was different to begin with... maybe an oversight as the parameter list appears to be the same.

@ghost ghost added frontend Visual issues, improvements, bugs or other aspects relating mostly to the front end sso Single-sign-on issues or pull requests labels Jun 4, 2024
@ghost ghost added this to the v1.6.1 milestone Jun 4, 2024
@ghost ghost assigned CocoPoops Jun 4, 2024
@ghost ghost added backend Backend related issues and pull requests and removed frontend Visual issues, improvements, bugs or other aspects relating mostly to the front end labels Jun 4, 2024
@CocoPoops
Copy link
Contributor Author

Good catch! Maybe we should make each of them do what the KbinAuthenticator.php onAuthenticationSuccess() method does for consistency?

public function onAuthenticationSuccess(Request $request, TokenInterface $token, string $firewallName): ?Response
{
if ($targetPath = $this->getTargetPath($request->getSession(), $firewallName)) {
return new RedirectResponse($targetPath);
} else {
return new RedirectResponse($this->urlGenerator->generate('front'));
}
}

Honestly I'm not sure why it was different to begin with... maybe an oversight as the parameter list appears to be the same.

i get a 500 error when logging with the function the way you suggested
i don't really know enough to know why that's the case

@ghost
Copy link

ghost commented Jun 4, 2024

Good catch! Maybe we should make each of them do what the KbinAuthenticator.php onAuthenticationSuccess() method does for consistency?

public function onAuthenticationSuccess(Request $request, TokenInterface $token, string $firewallName): ?Response
{
if ($targetPath = $this->getTargetPath($request->getSession(), $firewallName)) {
return new RedirectResponse($targetPath);
} else {
return new RedirectResponse($this->urlGenerator->generate('front'));
}
}

Honestly I'm not sure why it was different to begin with... maybe an oversight as the parameter list appears to be the same.

i get a 500 error when logging with the function the way you suggested i don't really know enough to know why that's the case

lol, that probably explains why it's different then.

@ghost ghost merged commit 7397c29 into MbinOrg:main Jun 4, 2024
7 checks passed
This pull request was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backend Backend related issues and pull requests sso Single-sign-on issues or pull requests
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant