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

Clean way to retrieve strategy (or call revokenToken indirectly) #98

Open
emiel opened this issue Jun 20, 2024 · 2 comments
Open

Clean way to retrieve strategy (or call revokenToken indirectly) #98

emiel opened this issue Jun 20, 2024 · 2 comments

Comments

@emiel
Copy link

emiel commented Jun 20, 2024

The documentation here has the following example:

let user = await authenticator.isAuthenticated(request, {
  failureRedirect: "/login",
});

let tokens = await strategy.revokeToken(user.accessToken);

Here revokeToken is being called directly on the strategy. I looked for a way to get the strategy by name through authenticator but it seems there is no way to do that now. Are there plans on adding this API or perhaps calling revokeToken indirectly from the authenticator?

@sergiodxa
Copy link
Owner

No, you can create the strategy in a variable that you export and then pass that variable to the authenticator.use method.

@emiel
Copy link
Author

emiel commented Jun 21, 2024

That is what I did. :)

Not sure where the API is going but you could consider a way to get the strategy by name from the authenticator.

Thanks!

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

2 participants