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

Refactor authentication code #2027

Merged
merged 22 commits into from Mar 25, 2022
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
@@ -1,5 +1,7 @@
package controllers;

import static play.mvc.Results.redirect;

import java.util.Optional;
import play.mvc.Http;
import play.mvc.Result;
Expand All @@ -11,14 +13,14 @@
public class LegacyRoutesController {

public Result idcsLoginWithRedirect(Http.Request request, Optional<String> redirectTo) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should the request be used in the body? I see it's dropped here. Is the intent to always redirect to the new handler rather than handle the old route through new refactored flow?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If I understand correctly, I think the redirect method used automatically passes in the request context. Here's the docs on it: https://www.playframework.com/documentation/2.8.x/JavaRouting#Reverse-routing

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes Shubha that was my understanding as well! Thanks for the docs! I can add them as a comment if you think it would be helpful Shane?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great! thanks yall!

return routes.LoginController.applicantLogin(redirectTo);
return redirect(routes.LoginController.applicantLogin(redirectTo));
}

public Result adfsLogin(Http.Request request) {
return routes.LoginController.adminLogin();
return redirect(routes.LoginController.adminLogin());
}

public Result loginRadiusLoginWithRedirect(Http.Request request, Optional<String> redirectTo) {
return routes.LoginController.applicantLogin(redirectTo);
return redirect(routes.LoginController.applicantLogin(redirectTo));
}
}