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

Fix post-auth redirect (Google auth, testing environment) #194

Merged
merged 1 commit into from
Jun 2, 2023

Conversation

jeffdaley
Copy link
Contributor

@jeffdaley jeffdaley commented Jun 2, 2023

Fixes a bug where clicking the "Authenticate with Google" button would throw an assertion while in the local environment.

@tracked _info: AuthenticatedUser | null = null;

get info(): AuthenticatedUser {
  assert("Authenticated must exist", this._info);
  return this._info;
}

We were incorrectly checking for the getter rather than the tracked property.

@jeffdaley jeffdaley requested a review from a team as a code owner June 2, 2023 14:05
@@ -188,7 +188,7 @@ export default class SessionService extends EmberSimpleAuthSessionService {
// Because we redirect as part of the authentication flow, the parameter storing the transition gets reset. Instead, we keep track of the redirectTarget in browser sessionStorage and override the handleAuthentication method as recommended by ember-simple-auth.

handleAuthentication(routeAfterAuthentication: string) {
if (this.authenticatedUser.info) {
if (this.authenticatedUser._info) {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is actually the property that can be null. The non-underscored version is asserted true.

@jeffdaley jeffdaley merged commit 694b246 into main Jun 2, 2023
@jeffdaley jeffdaley deleted the jeffdaley/fix-auto-assertion branch June 2, 2023 21:29
anuragprafulla pushed a commit to razorpay/hermes that referenced this pull request Jun 27, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants