mirror of
https://github.com/zitadel/zitadel.git
synced 2025-08-25 12:18:54 +00:00
fix url template
This commit is contained in:
@@ -84,7 +84,7 @@ export function LoginOTP({
|
||||
value: host
|
||||
? {
|
||||
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}` : ""),
|
||||
}
|
||||
: {},
|
||||
@@ -182,11 +182,11 @@ export function LoginOTP({
|
||||
|
||||
function setCodeAndContinue(values: Inputs, organization?: string) {
|
||||
return submitCode(values, organization).then(async (response) => {
|
||||
setLoading(true);
|
||||
// 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));
|
||||
if (response && "sessionId" in response) {
|
||||
setLoading(true);
|
||||
// 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));
|
||||
|
||||
if (response) {
|
||||
const url =
|
||||
authRequestId && response.sessionId
|
||||
? await getNextUrl(
|
||||
|
Reference in New Issue
Block a user