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

What if login is required? #34

Open
lostfields opened this issue Sep 11, 2024 · 1 comment
Open

What if login is required? #34

lostfields opened this issue Sep 11, 2024 · 1 comment

Comments

@lostfields
Copy link
Contributor

lostfields commented Sep 11, 2024

We have a few authorization calls where a login is required. We need a user interaction. As far as I can see this is not handled at

private _onTokenFailure({tokenConfig, error, license}: types.TokenError){
const errorsWhereAuthIsRequired = [
'login_required',
'consent_required',
'interaction_required',
'unauthorized'
]
const access: AccessFailure = {
type: 'failure',
tokenConfig,
token: null,
error,
license,
userInteractionRequired: errorsWhereAuthIsRequired.includes(error.error),
scopesAccepted: []
}
this._setAccess(access)
this.emit('access-failure', access)
}

This is only emitting access-failure that ends up in emitting authorization-failure

private _handleAuthorizationFailure(access: AccessFailure){
this.emit('authorization-failure', {access})
}

I noticed that we have a few console logs where a login is required when asking for new access token, and I don't think any of these actually redirects to login. How should we handle this? We are able to listen to this event in each website, but maybe we should handle this in package-boilerplate or in js-auth?

image

@lostfields
Copy link
Contributor Author

Any thoughts @ffjeanette @Luzenna ?

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

No branches or pull requests

1 participant