stack icon indicating copy to clipboard operation
stack copied to clipboard

[Bug] Discord `oauthScopesOnSignIn` not taking effect

Open Ariastarcos opened this issue 9 months ago • 3 comments

The following configuration is not respected, only the default identity and email scopes are used when signing in:

export const stackServerApp = new StackServerApp({
  // ...
  oauthScopesOnSignIn: {
    discord: ["identify", "email", "guilds"],
  }
});

I am not sure if this issue is limited to Discord.

Ariastarcos avatar Apr 06 '25 22:04 Ariastarcos

Perhaps it would be interesting to be able to set default scopes for OAuth providers from the service dashboard, is this something that was ever considered?

Ariastarcos avatar Apr 06 '25 22:04 Ariastarcos

I guess this was a result of connecting the account before specifying oauthScopesOnSignIn, since calling useConnectedAccount on the CurrentUser does update the connection to include the scopes.

Ariastarcos avatar Apr 07 '25 13:04 Ariastarcos

How do you get the access token? So you still need to require the scopes when using useConnectedAccounts('discord', { scopes: [...scopes you need]} );

fomalhautb avatar May 15 '25 17:05 fomalhautb

Can't reproduce this error. Let me know if anyone encounters this again

fomalhautb avatar Jul 01 '25 23:07 fomalhautb