Skip to content

Commit 6e62b7e

Browse files
committed
fix(type): hoist Provider type
1 parent a2170cc commit 6e62b7e

File tree

1 file changed

+3
-8
lines changed

1 file changed

+3
-8
lines changed

src/index.tsx

+3-8
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ type authChangeParam = (user?: User) => string | void;
2020

2121
export type Settings = GoTrueSettings;
2222
export type User = GoTrueUser;
23+
type Provider = 'bitbucket' | 'github' | 'gitlab' | 'google';
2324

2425
const defaultSettings = {
2526
autoconfirm: false,
@@ -66,13 +67,8 @@ export type ReactNetlifyIdentityAPI = {
6667
};
6768
_goTrueInstance: GoTrue;
6869
_url: string;
69-
loginProvider: (
70-
provider: 'bitbucket' | 'github' | 'gitlab' | 'google'
71-
) => void;
72-
acceptInviteExternalUrl: (
73-
provider: 'bitbucket' | 'github' | 'gitlab' | 'google',
74-
token: string
75-
) => string;
70+
loginProvider: (provider: Provider) => void;
71+
acceptInviteExternalUrl: (provider: Provider, token: string) => string;
7672
settings: Settings;
7773
};
7874

@@ -140,7 +136,6 @@ export function useNetlifyIdentity(
140136
// make sure the Registration preferences under Identity settings in your Netlify dashboard are set to Open.
141137
// https://react-netlify-identity.netlify.com/login#access_token=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHAiOjE1NTY0ODY3MjEsInN1YiI6ImNiZjY5MTZlLTNlZGYtNGFkNS1iOTYzLTQ4ZTY2NDcyMDkxNyIsImVtYWlsIjoic2hhd250aGUxQGdtYWlsLmNvbSIsImFwcF9tZXRhZGF0YSI6eyJwcm92aWRlciI6ImdpdGh1YiJ9LCJ1c2VyX21ldGFkYXRhIjp7ImF2YXRhcl91cmwiOiJodHRwczovL2F2YXRhcnMxLmdpdGh1YnVzZXJjb250ZW50LmNvbS91LzY3NjQ5NTc_dj00IiwiZnVsbF9uYW1lIjoic3d5eCJ9fQ.E8RrnuCcqq-mLi1_Q5WHJ-9THIdQ3ha1mePBKGhudM0&expires_in=3600&refresh_token=OyA_EdRc7WOIVhY7RiRw5w&token_type=bearer
142138
/******* external oauth */
143-
type Provider = 'bitbucket' | 'github' | 'gitlab' | 'google';
144139

145140
const loginProvider = (provider: Provider) => {
146141
const url = goTrueInstance.loginExternalUrl(provider);

0 commit comments

Comments
 (0)