DEV Community

TK
TK

Posted on

sk-auth redirect https... ...

I tried to develop authrization with Google Oauth via sk-auth. sk-auth is library of SvelteKit like NextAuth.

If we wanna change redirect url from https to http, we can use below code.

export const appAuth = new SvelteKitAuth({
    // We can change that by protocol property.
    protocol: 'http',
    jwtSecret: import.meta.env.VITE_JWT_SECRET,
    providers: [
        new Providers.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' };
            },
        })
    ],
});

Enter fullscreen mode Exit fullscreen mode

Top comments (0)