fix(19): CR-01 align OIDC-link client contract with server (authorizationUrl)

This commit is contained in:
Lucas Berger
2026-06-17 20:15:23 -04:00
parent 4b635784e4
commit 1688f229e0
2 changed files with 17 additions and 7 deletions
+8 -2
View File
@@ -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.');