From 500477a4e20f070f369b5440f9e1d02a7dbae90d Mon Sep 17 00:00:00 2001 From: RaviAnand Mohabir Date: Mon, 24 May 2021 16:23:18 +0200 Subject: [PATCH] =?UTF-8?q?=E2=9C=8F=EF=B8=8F=20Update=20imports=20in=20de?= =?UTF-8?q?mo=20app?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/src/lib/appAuth.ts | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/app/src/lib/appAuth.ts b/app/src/lib/appAuth.ts index 7c8b1a1..915f929 100644 --- a/app/src/lib/appAuth.ts +++ b/app/src/lib/appAuth.ts @@ -1,21 +1,21 @@ import { SvelteKitAuth } from "sk-auth"; import { - FacebookAuthProvider, - GoogleOAuthProvider, - RedditOAuthProvider, + FacebookOAuth2Provider, + GoogleOAuth2Provider, + RedditOAuth2Provider, TwitterAuthProvider, } from "sk-auth/providers"; export const appAuth = new SvelteKitAuth({ providers: [ - new GoogleOAuthProvider({ + new GoogleOAuth2Provider({ clientId: import.meta.env.VITE_GOOGLE_OAUTH_CLIENT_ID, clientSecret: import.meta.env.VITE_GOOGLE_OAUTH_CLIENT_SECRET, profile(profile) { return { ...profile, provider: "google" }; }, }), - new FacebookAuthProvider({ + new FacebookOAuth2Provider({ clientId: import.meta.env.VITE_FACEBOOK_OAUTH_CLIENT_ID, clientSecret: import.meta.env.VITE_FACEBOOK_OAUTH_CLIENT_SECRET, profile(profile) { @@ -29,11 +29,11 @@ export const appAuth = new SvelteKitAuth({ return { ...profile, provider: "twitter" }; }, }), - new RedditOAuthProvider({ + new RedditOAuth2Provider({ apiKey: import.meta.env.VITE_REDDIT_API_KEY, apiSecret: import.meta.env.VITE_REDDIT_API_SECRET, profile(profile) { - profile = RedditOAuthProvider.profileHandler(profile); + profile = RedditOAuth2Provider.profileHandler(profile); return { ...profile, provider: "reddit" }; }, }), @@ -45,8 +45,8 @@ export const appAuth = new SvelteKitAuth({ token = { ...token, user: { - ...token.user, - connections: { ...token.user.connections, [provider]: account }, + ...(token.user ?? {}), + connections: { ...(token.user?.connections ?? {}), [provider]: account }, }, }; }