completionId: cgen-ae50323d53054d36a15265e0d013c95e
cgen-ae50323d53054d36a15265e0d013c95e
This commit is contained in:
parent
559c470dbc
commit
b6d7b34e9b
1 changed files with 6 additions and 3 deletions
|
|
@ -32,11 +32,14 @@ export default function DiscordVerify() {
|
|||
}, [code]);
|
||||
|
||||
useEffect(() => {
|
||||
// Redirect if not authenticated
|
||||
// Redirect if not authenticated, preserving the code param
|
||||
if (!user) {
|
||||
navigate("/login?next=/profile/link-discord");
|
||||
const redirectUrl = code
|
||||
? `/login?next=/discord-verify?code=${code}`
|
||||
: "/login?next=/profile/link-discord";
|
||||
navigate(redirectUrl);
|
||||
}
|
||||
}, [user, navigate]);
|
||||
}, [user, navigate, code]);
|
||||
|
||||
const handleVerify = async (codeToVerify: string) => {
|
||||
if (!codeToVerify.trim()) {
|
||||
|
|
|
|||
Loading…
Reference in a new issue