Refactored Scopes for oAuth providers
This commit is contained in:
@@ -12,6 +12,20 @@ import { Trans } from '@kit/ui/trans';
|
|||||||
import { AuthErrorAlert } from './auth-error-alert';
|
import { AuthErrorAlert } from './auth-error-alert';
|
||||||
import { AuthProviderButton } from './auth-provider-button';
|
import { AuthProviderButton } from './auth-provider-button';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @name OAUTH_SCOPES
|
||||||
|
* @description
|
||||||
|
* The OAuth scopes are used to specify the permissions that the application is requesting from the user.
|
||||||
|
*
|
||||||
|
* Please add your OAuth providers here and the scopes you want to use.
|
||||||
|
*
|
||||||
|
* @see https://supabase.com/docs/guides/auth/social-login
|
||||||
|
*/
|
||||||
|
const OAUTH_SCOPES: Partial<Record<Provider, string>> = {
|
||||||
|
azure: 'email',
|
||||||
|
// add your OAuth providers here
|
||||||
|
};
|
||||||
|
|
||||||
export function OauthProviders(props: {
|
export function OauthProviders(props: {
|
||||||
inviteToken?: string;
|
inviteToken?: string;
|
||||||
shouldCreateUser: boolean;
|
shouldCreateUser: boolean;
|
||||||
@@ -75,13 +89,7 @@ export function OauthProviders(props: {
|
|||||||
].join('?');
|
].join('?');
|
||||||
|
|
||||||
const redirectTo = [origin, redirectPath].join('');
|
const redirectTo = [origin, redirectPath].join('');
|
||||||
|
const scopesOpts = OAUTH_SCOPES[provider] ?? {};
|
||||||
const scopesOpts =
|
|
||||||
provider === 'azure'
|
|
||||||
? {
|
|
||||||
scopes: 'email',
|
|
||||||
}
|
|
||||||
: {};
|
|
||||||
|
|
||||||
const credentials = {
|
const credentials = {
|
||||||
provider,
|
provider,
|
||||||
|
|||||||
Reference in New Issue
Block a user