fix(#2227): fix auth redirect for facr

keep-around/2b4443a47f54ced1100a8dfd42fdb30c1cdcf9bb
Andrei Dekterev 4 years ago
parent 7991b3a157
commit 2b4443a47f
  1. 5
      src/features/AuthServiceApp/components/Login/hooks.tsx
  2. 4
      src/features/AuthServiceApp/requests/auth.tsx

@ -48,6 +48,7 @@ export const useLoginForm = () => {
const submitForm = () => formRef.current?.submit()
const redirect_url = new URLSearchParams(location.search).get('redirect_uri')
const clientId = new URLSearchParams(location.search).get('client_id')
const {
client_id,
@ -58,6 +59,7 @@ export const useLoginForm = () => {
} = getClientSettings()
const currentRedirectUrl = redirect_url ?? redirect_uri
const currentClientId = clientId ?? client_id
const handleError = (error: string) => {
setAuthError(error)
@ -69,6 +71,7 @@ export const useLoginForm = () => {
setIsFetching(true)
try {
await loginCheck(
currentClientId,
email,
lang,
password,
@ -86,7 +89,7 @@ export const useLoginForm = () => {
return {
authError,
client_id,
client_id: currentClientId,
email,
formError,
formRef,

@ -21,20 +21,20 @@ type SuccessResponse = {
}
export const loginCheck = async (
currentClientId: string | undefined,
email: string,
lang: string,
password: string,
currentRedirectUrl: string | undefined,
) => {
const {
client_id,
response_mode,
response_type,
scope,
} = getClientSettings()
const paramsUrl = {
client_id,
client_id: currentClientId,
lang,
redirect_uri: currentRedirectUrl,
response_mode,

Loading…
Cancel
Save