Skip to content

Commit

Permalink
refactor: update auth config
Browse files Browse the repository at this point in the history
  • Loading branch information
altaywtf committed Dec 17, 2023
1 parent 6dace10 commit f7adc6f
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
6 changes: 5 additions & 1 deletion lib/services/account.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,11 @@ export const updateAccount = async ({
{
avatar_url: metadata.avatar_url || '',
name:
metadata.preferred_username || metadata.user_name || user.email || '',
metadata.preferred_username ||
metadata.user_name ||
metadata.name ||
user.email ||
'',
provider_refresh_token: session.provider_refresh_token || '',
provider_token: session.provider_token || '',
user_id: user.id,
Expand Down
9 changes: 8 additions & 1 deletion lib/services/supabase/auth.ts
Original file line number Diff line number Diff line change
Expand Up @@ -88,5 +88,12 @@ export const getUser = async () => {
return userQuery.data.user;
};

const CONFIGURED_OAUTH_PROVIDERS: SignInWithOAuthCredentials['provider'][] = [
'github',
'spotify',
];

export const ENABLED_OAUTH_PROVIDERS: SignInWithOAuthCredentials['provider'][] =
['github', 'spotify'];
process.env.NODE_ENV === 'development'
? CONFIGURED_OAUTH_PROVIDERS
: ['github'];

1 comment on commit f7adc6f

@vercel
Copy link

@vercel vercel bot commented on f7adc6f Dec 17, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.