Update redirect behavior in auth success state
The commit introduces changes to the behavior of the "Update Password" page on a successful password update. Instead of redirecting the user back to the home page upon a successful update, the updated code now redirects the user to a specified URL passed in as a prop. The authentication configuration has also been updated to include a list of acceptable redirect URLs.
This commit is contained in:
@@ -45,11 +45,12 @@ class AuthCallbackService {
|
||||
|
||||
const token_hash = searchParams.get('token_hash');
|
||||
const type = searchParams.get('type') as EmailOtpType | null;
|
||||
const next = searchParams.get('next') ?? params.redirectPath;
|
||||
const callbackParam = searchParams.get('callback');
|
||||
|
||||
const next = callbackParam ? new URL(callbackParam).pathname : params.redirectPath;
|
||||
|
||||
const callbackUrl = callbackParam ? new URL(callbackParam) : null;
|
||||
const inviteToken = callbackUrl?.searchParams.get('invite_token');
|
||||
|
||||
const errorPath = params.errorPath ?? '/auth/callback/error';
|
||||
|
||||
// remove the query params from the url
|
||||
|
||||
Reference in New Issue
Block a user