import { fd, get, register } from "$lib/utils"; import { redirect } from "@sveltejs/kit"; export const load = async ({ parent }) => { const { user } = await parent(); if (user) redirect(307, `/${user.username}`); const index = Math.floor(Math.random() * 64) + 1; const { challenge } = await get("/challenge"); return { index, challenge }; }; export const actions = { default: async ({ cookies, request }) => { const ip = request.headers.get("cf-connecting-ip"); const form = await fd(request); const { picture, username, password } = form; let { loginRedirect } = form; if (loginRedirect === "undefined") loginRedirect = undefined; const user = { picture, username, password }; await register(user, ip, cookies, loginRedirect); }, }; 'get'> coinos ui — legacy coinos.io web app (SvelteKit)coinos
aboutsummaryrefslogtreecommitdiffstats
path: root/src/components/AppHeader.svelte
blob: d0123650c6abda5c36a7bbdc1e0798b237bac2a2 (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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86