use more server crap, hopefully fix redir loop
This commit is contained in:
parent
77dd220e48
commit
9f6cb8ba84
4 changed files with 10 additions and 4 deletions
|
@ -114,7 +114,7 @@ export function initAuth(router: express.Router) {
|
|||
router.get(
|
||||
"/auth/new-login",
|
||||
(req: Request, res: Response, next: NextFunction) => {
|
||||
res.cookie("redir", `/new/login-callback/`, { httpOnly: true });
|
||||
res.cookie("redir", `/new/auth/login-callback/`, { httpOnly: true });
|
||||
|
||||
next();
|
||||
},
|
||||
|
|
|
@ -7,7 +7,11 @@
|
|||
|
||||
<div class="splash">
|
||||
<div id="error" class:has-error={data.error}>
|
||||
{data.error}
|
||||
{#if data.error}
|
||||
<div class="message">
|
||||
{data.error}
|
||||
</div>
|
||||
{/if}
|
||||
</div>
|
||||
<div class="wrapper">
|
||||
<div class="logo-column">
|
||||
|
|
|
@ -1,10 +1,12 @@
|
|||
import { redirect } from '@sveltejs/kit';
|
||||
import type { PageServerLoad } from './$types';
|
||||
import type { RequestHandler } from './$types';
|
||||
|
||||
export const load: PageServerLoad = ({ cookies }) => {
|
||||
export const GET: RequestHandler = ({ cookies }) => {
|
||||
const apiKey = String(cookies.get('apiKey') ?? '');
|
||||
|
||||
if (!apiKey) {
|
||||
return redirect(307, `${process.env.API_URL}/auth/new-login`);
|
||||
}
|
||||
|
||||
return redirect(302, `${process.env.DASHBOARD_URL}/new/dashboard`);
|
||||
};
|
Loading…
Add table
Reference in a new issue