diff --git a/app/decorators/check-auth.ts b/app/decorators/check-auth.ts index 38cac24562a..16ea7b27ed9 100644 --- a/app/decorators/check-auth.ts +++ b/app/decorators/check-auth.ts @@ -37,10 +37,12 @@ export default function checkAuth>( // Need to handle view-only links before checking auth, and this is the only reasonable place to do it. // This limitation points toward replacing this decorator with a service method meant to be // called in Route.beforeModel. Decorator mixins should probably be considered an anti-pattern. - const { viewOnlyToken = '' } = this.paramsFor('application') as Record; + let { viewOnlyToken = '' } = this.paramsFor('application') as Record; try { if (!this.session.isAuthenticated || this.currentUser.viewOnlyToken !== viewOnlyToken) { + // This is for ENG-8174 where occasionally a %2F or / is at the end of the viewOnlyToken + viewOnlyToken = viewOnlyToken.replace(/(%2[fF]|\/)$/g, ''); this.currentUser.setProperties({ viewOnlyToken }); // Check whether user is actually logged in. diff --git a/mirage/views/addons.ts b/mirage/views/addons.ts index e77522960c3..b5801d6be5f 100644 --- a/mirage/views/addons.ts +++ b/mirage/views/addons.ts @@ -478,7 +478,7 @@ function fakeCheckCredentials( async function emulateUserDoingOAuthFlow(authorizedAccount: ModelInstance, schema: Schema) { await timeout(1000); // eslint-disable-next-line no-console - console.log('Mirage addons view: emulateUserDoingOAuthFlow done'); + console.info('Mirage addons view: emulateUserDoingOAuthFlow done'); const currentUser = schema.roots.first().currentUser; authorizedAccount.update({ credentialsAvailable: true,