-
Notifications
You must be signed in to change notification settings - Fork 87
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
feat(api): collapse spcp/myinfo redirect endpoint to new endpoint #1672
Conversation
831430c
to
8941290
Compare
collapsed middleware functions and all auth types are now inferred from teh db retrieval of the form
… a directive apparently angularJS still has the directive registered even if it's unused and this means that it bugs...
8edd221
to
5a1b17b
Compare
…o mapRouteError in public form
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.
a couple more changes; pls test on staging/local
src/public/modules/forms/base/directives/submit-form.directive.js
Outdated
Show resolved
Hide resolved
src/app/modules/submission/email-submission/__tests__/email-submission.routes.spec.ts
Show resolved
Hide resolved
removed old myinfo specific type and used general types instead; added a typeguard rather than casting to preserve information in teh typesystem that would otherwise be lost
…ormAuthRedirectError adds utility method so business logic for generating endpoint isn't seen by controller. added separate handler for mapping application errors back to http errors for redirection because it is sufficiently different from teh normal flow
…rMe to isPersistentLogin
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.
lgtm with comments
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.
possible bug with persistent logins. have you tested that persistent logins are working?
src/public/modules/forms/base/directiveViews/submit-form.directive.view.html
Show resolved
Hide resolved
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.
approving because I don't think the isPersistentLogin
thing is a bug, but do test that extended logins work before merging
@mantariksh could you clarify abit on the extended login? it's that for sp forms, clicking on remember me should cause users to be persistently logged in even after refreshing/leaving and returning back to the page right? to be safe, i'll push this to staging and test it there! |
@seaerchin extended login means the Singpass cookie should expire after 30 days instead of the usual 1 hour |
@mantariksh gotcha, will do! |
…re descriptive; updated docs
Part 1 of #1517
Problem
Previously, our
/auth/redirect
endpoints were split between theMyInfo
andspcp
sections, which made code harder to maintain and our frontend had separated logic.Separately, this is also part of the
/api/v3
migration to shift endpoints to their new homesSolution
This PR merges the 2 endpoints into 1 and shifts it into a new route rooted at
/api/v3
Features:
auth.controller
to handle the redirects for backend/api/v3
routesAuthService
on frontend side as part of react migrationNotes
MyInfoService
will be fully deleted in part 2 of this PR. it is left as is first.Tests
Tests are here to avoid review fatigue
Manual Tests