Loading packages/client/src/components/Toolbar/Palette.tsx +4 −7 Original line number Diff line number Diff line Loading @@ -32,14 +32,11 @@ export const Palette = () => { }, []); const handleLogin = useCallback(() => { fetch("/api/login", { redirect: "manual", }).then(async (res) => { const location = res.headers.get("location"); if (location) { window.location.href = location; } else { fetch("/api/login").then(async (res) => { const data = await res.json(); if (data.success) { window.location.href = data.redirect; } else { if ("error" in data) { toast.error("Error while logging in: " + data.error); } Loading packages/server/src/api/auth.ts +4 −1 Original line number Diff line number Diff line Loading @@ -12,7 +12,10 @@ export const AuthEndpoints = Router(); */ AuthEndpoints.get("/login", (req, res) => { try { res.redirect(OpenIDController.get().getAuthorizationURL()); res.json({ success: true, redirect: OpenIDController.get().getAuthorizationURL(), }); } catch (e) { if (e instanceof InvalidAuthMode) { res.status(400).json({ Loading Loading
packages/client/src/components/Toolbar/Palette.tsx +4 −7 Original line number Diff line number Diff line Loading @@ -32,14 +32,11 @@ export const Palette = () => { }, []); const handleLogin = useCallback(() => { fetch("/api/login", { redirect: "manual", }).then(async (res) => { const location = res.headers.get("location"); if (location) { window.location.href = location; } else { fetch("/api/login").then(async (res) => { const data = await res.json(); if (data.success) { window.location.href = data.redirect; } else { if ("error" in data) { toast.error("Error while logging in: " + data.error); } Loading
packages/server/src/api/auth.ts +4 −1 Original line number Diff line number Diff line Loading @@ -12,7 +12,10 @@ export const AuthEndpoints = Router(); */ AuthEndpoints.get("/login", (req, res) => { try { res.redirect(OpenIDController.get().getAuthorizationURL()); res.json({ success: true, redirect: OpenIDController.get().getAuthorizationURL(), }); } catch (e) { if (e instanceof InvalidAuthMode) { res.status(400).json({ Loading