fix(#2227): fix redirect url for localhost

keep-around/7991b3a157e021bbcc8ede838d66b0c34e290e71
Andrei Dekterev 4 years ago
parent 3189b32b0c
commit 7991b3a157
  1. 4
      src/features/AuthServiceApp/requests/auth.tsx
  2. 12
      src/features/AuthStore/helpers.tsx

@ -24,7 +24,7 @@ export const loginCheck = async (
email: string,
lang: string,
password: string,
redirect_uri: string | undefined,
currentRedirectUrl: string | undefined,
) => {
const {
client_id,
@ -36,7 +36,7 @@ export const loginCheck = async (
const paramsUrl = {
client_id,
lang,
redirect_uri,
redirect_uri: currentRedirectUrl,
response_mode,
response_type,
scope,

@ -6,6 +6,16 @@ import { AUTH_SERVICE } from 'config/routes'
import { ENV } from 'config/env'
const redirectUrl = () => {
if (process.env.NODE_ENV === 'development') {
return `${window.origin}/redirect`
}
if (ENV === 'staging') {
return `https://${ENV}.${client.name}.tv/redirect`
}
return `https://${client.name}.tv/redirect`
}
export const getClientSettings = (): UserManagerSettings => ({
authority: AUTH_SERVICE,
automaticSilentRenew: true,
@ -13,7 +23,7 @@ export const getClientSettings = (): UserManagerSettings => ({
filterProtocolClaims: false,
loadUserInfo: false,
metadataUrl: `${AUTH_SERVICE}/.well-known/openid-configuration${client.auth.metaDataUrlParams || ''}`,
redirect_uri: ENV === 'staging' ? `https://${ENV}.${client.name}.tv/redirect` : `https://${client.name}.tv/redirect`,
redirect_uri: redirectUrl(),
response_mode: 'query',
response_type: 'id_token token',
scope: 'openid',

Loading…
Cancel
Save