import { fail, redirect } from "@sveltejs/kit";
import { fd, post, login } from "$lib/utils";
export const actions = {
default: async ({ cookies, params, request }) => {
const ip = request.headers.get("cf-connecting-ip");
let error;
const { code } = params;
const { password } = await fd(request);
try {
const user = await post("/reset", { code, password });
user.password = password;
try {
await login(user, cookies, ip);
error = null;
} catch (e: any) {
error ||= e.message;
}
if (error) return fail(400, { error });
redirect(307, `/${user.username}`);
} catch (e: any) {
console.log(e.message);
return fail(400, { error: e.message });
}
},
};
get'>
blob: 1689e207f6a8df4394bf09928a6dbd608e60ae3a (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
|
@tailwind base;
@tailwind components;
@tailwind utilities;
@font-face {
font-family: 'PublicSans';
src: url('/fonts/Public_Sans/static/PublicSans-Regular.ttf') format('truetype');
}
html {
font-family: PublicSans, sans-serif;
}
::selection {
color: black;
background: #eaf2ff;
}
:fullscreen {
background-color: white;
}
input, textarea {
@apply block border rounded-2xl px-5 py-4 w-full;
}
button.primary {
@apply rounded-full border py-2 font-bold my-4 flex px-4 bg-white mx-auto hover:opacity-80;
}
.select-styles {
@apply border rounded-2xl py-4 px-5;
cursor: pointer;
-webkit-appearance: none;
-moz-appearance: none;
background: transparent;
background-image: url('/icons/down.svg');
background-repeat: no-repeat;
background-position-x: 95%;
background-position-y: 1em;
}
|