mirror of
https://github.com/woodchen-ink/Q58Connect.git
synced 2025-07-18 14:01:55 +08:00
fix: Decode callback URL and reset loading state on authentication error
This commit is contained in:
parent
7188c46cd7
commit
f40979b4ad
@ -26,7 +26,8 @@ export function UserAuthForm({
|
|||||||
const body: Record<string, any> = {};
|
const body: Record<string, any> = {};
|
||||||
const callbackUrl = searchParams?.get("callbackUrl");
|
const callbackUrl = searchParams?.get("callbackUrl");
|
||||||
if (callbackUrl) {
|
if (callbackUrl) {
|
||||||
body.return_url = callbackUrl;
|
const decodedUrl = decodeURIComponent(callbackUrl);
|
||||||
|
body.return_url = decodedUrl;
|
||||||
}
|
}
|
||||||
|
|
||||||
const response = await fetch("/api/auth/q58", {
|
const response = await fetch("/api/auth/q58", {
|
||||||
@ -50,6 +51,7 @@ export function UserAuthForm({
|
|||||||
description: "登录过程中发生错误,请稍后重试",
|
description: "登录过程中发生错误,请稍后重试",
|
||||||
variant: "destructive",
|
variant: "destructive",
|
||||||
});
|
});
|
||||||
|
setIsLoading(false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user