sergiodxa / remix-auth-oauth2

A OAuth2Strategy for Remix Auth
https://sergiodxa.github.io/remix-auth-oauth2/
MIT License
144 stars 50 forks source link

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

Open emiel opened 1 month ago

emiel commented 1 month ago

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 commented 1 month ago

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

emiel commented 1 month ago

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!