fix(19): CR-01 align OIDC-link client contract with server (authorizationUrl)
This commit is contained in:
@@ -859,9 +859,15 @@ function LinkOidcSheet({ isOpen, onClose }: LinkOidcSheetProps) {
|
||||
const linkMutation = useMutation({
|
||||
mutationFn: fetchLinkOidc,
|
||||
onSuccess: (data) => {
|
||||
// Close the sheet and initiate OIDC link flow
|
||||
// authorizationUrl is null when OIDC is not configured in env (server could not
|
||||
// build the URL). Do NOT navigate to null — surface an error and keep the sheet open.
|
||||
if (!data.authorizationUrl) {
|
||||
setError('Something went wrong. Please try again.');
|
||||
return;
|
||||
}
|
||||
// Close the sheet and initiate the OIDC link flow via top-level navigation.
|
||||
onClose();
|
||||
window.location.href = data.redirectUrl;
|
||||
window.location.href = data.authorizationUrl;
|
||||
},
|
||||
onError: () => {
|
||||
setError('Something went wrong. Please try again.');
|
||||
|
||||
Reference in New Issue
Block a user