Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion web/biome.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"includes": [
"src/**",
"!src/messages",
"!src/paraglide/**/*.js",
"!src/paraglide/**",
"!src/routeTree.gen.ts"
]
},
Expand Down
1 change: 1 addition & 0 deletions web/messages/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,7 @@
"openid_mfa_redirect_error_missing_args": "Missing code or state in the callback's URL. The provider might not be configured correctly.",
"openid_mfa_complete_title": "Authentication Completed",
"openid_mfa_complete_subtitle": "You have been successfully authenticated. Please close this window and get back to the Defguard VPN Client",
"openid_generic_error": "OpenID authentication error",
"open_desktop_title": "Open the desktop app to continue",
"open_desktop_description": "We tried to open the desktop app automatically, but it didn't respond. This can happen if the browser blocks the request or the app didn't start in time.",
"open_desktop_button": "Open desktop app",
Expand Down
61 changes: 42 additions & 19 deletions web/pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 6 additions & 2 deletions web/src/routes/openid/callback.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
import { createFileRoute, redirect } from '@tanstack/react-router';
import z from 'zod';
import { m } from '../../paraglide/messages';
import { api } from '../../shared/api/api';
import { useEnrollmentStore } from '../../shared/hooks/useEnrollmentStore';
import { useOpenidStore } from '../../shared/hooks/useOpenIdStore';

const schema = z.object({
state: z.string().trim().min(1),
Expand All @@ -26,8 +28,10 @@ export const Route = createFileRoute('/openid/callback')({
},
})
.catch((e) => {
console.error(e);
throw redirect({ to: '/enrollment-start', replace: true });
useOpenidStore.setState({
error: e.response?.data?.error ?? m.openid_generic_error(),
});
throw redirect({ to: '/openid/error', replace: true });
});
const enrollmentStartResponse = await api.enrollment.start
.callbackFn({
Expand Down
Loading