mirror of
https://github.com/zitadel/zitadel.git
synced 2025-08-25 17:47:31 +00:00
fix url template
This commit is contained in:
@@ -84,7 +84,7 @@ export function LoginOTP({
|
|||||||
value: host
|
value: host
|
||||||
? {
|
? {
|
||||||
urlTemplate:
|
urlTemplate:
|
||||||
`${host.includes("localhost") ? "http://" : "https://"}${host}/otp/method=${method}?code={{.Code}}&userId={{.UserID}}&sessionId={{.SessionID}}` +
|
`${host.includes("localhost") ? "http://" : "https://"}${host}/otp/${method}?code={{.Code}}&userId={{.UserID}}&sessionId={{.SessionID}}` +
|
||||||
(authRequestId ? `&authRequestId=${authRequestId}` : ""),
|
(authRequestId ? `&authRequestId=${authRequestId}` : ""),
|
||||||
}
|
}
|
||||||
: {},
|
: {},
|
||||||
@@ -182,11 +182,11 @@ export function LoginOTP({
|
|||||||
|
|
||||||
function setCodeAndContinue(values: Inputs, organization?: string) {
|
function setCodeAndContinue(values: Inputs, organization?: string) {
|
||||||
return submitCode(values, organization).then(async (response) => {
|
return submitCode(values, organization).then(async (response) => {
|
||||||
|
if (response && "sessionId" in response) {
|
||||||
setLoading(true);
|
setLoading(true);
|
||||||
// Wait for 2 seconds to avoid eventual consistency issues with an OTP code being verified in the /login endpoint
|
// Wait for 2 seconds to avoid eventual consistency issues with an OTP code being verified in the /login endpoint
|
||||||
await new Promise((resolve) => setTimeout(resolve, 2000));
|
await new Promise((resolve) => setTimeout(resolve, 2000));
|
||||||
|
|
||||||
if (response) {
|
|
||||||
const url =
|
const url =
|
||||||
authRequestId && response.sessionId
|
authRequestId && response.sessionId
|
||||||
? await getNextUrl(
|
? await getNextUrl(
|
||||||
|
Reference in New Issue
Block a user