Dan6erbond / sk-auth

Authentication library for use with SvelteKit featuring built-in OAuth providers and zero restriction customization!
MIT License
578 stars 70 forks source link

Allow setting of "redirect_uri" #95

Closed websocket98765 closed 2 years ago

websocket98765 commented 2 years ago

sk-auth defaults to https://localhost:3000/api/auth/callback/github with no ability to change it successfully.

Note the s in https.

This is problematic because for localtesting where https isn't used.

moreorover commented 2 years ago

The protocol can be set when creating a SvelteKitAuth object.

export const appAuth: SvelteKitAuth = new SvelteKitAuth({ providers: [oauthProvider], protocol: 'http' });

websocket98765 commented 2 years ago

Thank you! I did the following

import { dev } from '$app/env';

export const appAuth = new SvelteKitAuth({
  protocol: dev ? 'http' : 'https',
  providers: [
    // ...
  ],
  // ...
});