prepare for being available on multiple domain names
This commit is contained in:
@ -7,9 +7,10 @@ const { DEV } = import.meta.env;
|
||||
|
||||
const logger = new Logger('SpotifyAuth');
|
||||
|
||||
export const load: PageServerLoad = async ({ url }) => {
|
||||
export const load: PageServerLoad = async ({ url, request }) => {
|
||||
const baseUrl = request.headers.get('X-Forwarded-Host') ?? BASE_URL;
|
||||
const adder = new SpotifyPlaylistAdder();
|
||||
let redirect_uri = new URL(`${BASE_URL}/spotifyAuth`);
|
||||
let redirect_uri = new URL(`${new URL(BASE_URL).protocol}//${baseUrl}/spotifyAuth`);
|
||||
if (url.hostname === 'localhost' && DEV) {
|
||||
redirect_uri.hostname = '127.0.0.1';
|
||||
}
|
||||
|
Reference in New Issue
Block a user