alpha
Login
or
Join now
dunkirk.sh
/
core
forked from
tangled.org/core
Star
0
Fork
0
Atom
Configure Feed
Issues
Pull Requests
Commits
Tags
Feed URL
Select the types of activity you want to include in your feed.
This repository has no description
Star
0
Fork
0
Atom
Configure Feed
Issues
Pull Requests
Commits
Tags
Feed URL
Select the types of activity you want to include in your feed.
Overview
Issues
Pulls
Pipelines
fix login redirect using hx-redirect
author
Anirudh Oppiliappan
date
1 year ago
(Feb 14, 2025, 10:55 PM +0200)
commit
fe8cc7f5
fe8cc7f52d48c396e7ead19625c8c9168fc21fdb
parent
fbb8d459
fbb8d459c1495fe82fc0f9b4450ee949b2ef125a
+27
-28
2 changed files
Expand all
Collapse all
Unified
Split
appview
pages
templates
user
login.html
state
state.go
+26
-27
appview/pages/templates/user/login.html
Reviewed
···
14
14
<body class="flex items-center justify-center min-h-screen">
15
15
<main class="max-w-64">
16
16
<h1 class="text-center text-2xl font-semibold">tangled.sh</h1>
17
17
-
<form class="w-full" hx-post="/login" hx-swap="none" hx-disabled-elt="this">
18
18
-
<div class="flex flex-col">
19
19
-
<label for="handle">handle</label>
20
20
-
<input
21
21
-
type="text"
22
22
-
id="handle"
23
23
-
name="handle"
24
24
-
required
25
25
-
class="bg-gray-100 rounded p-1"
26
26
-
/>
27
27
-
</div>
17
17
+
<form
18
18
+
class="w-full"
19
19
+
hx-post="/login"
20
20
+
hx-swap="none"
21
21
+
hx-disabled-elt="this"
22
22
+
>
23
23
+
<div class="flex flex-col">
24
24
+
<label for="handle">handle</label>
25
25
+
<input type="text" id="handle" name="handle" required />
26
26
+
</div>
28
27
29
29
-
<div class="flex flex-col mt-2">
30
30
-
<label for="app_password">app password</label>
31
31
-
<input
32
32
-
type="password"
33
33
-
id="app_password"
34
34
-
name="app_password"
35
35
-
required
36
36
-
class="bg-gray-100 rounded p-1"
37
37
-
/>
38
38
-
</div>
28
28
+
<div class="flex flex-col mt-2">
29
29
+
<label for="app_password">app password</label>
30
30
+
<input
31
31
+
type="password"
32
32
+
id="app_password"
33
33
+
name="app_password"
34
34
+
required
35
35
+
/>
36
36
+
</div>
39
37
40
40
-
<button
41
41
-
class="btn w-full my-2 mt-6"
42
42
-
type="submit"
43
43
-
id="login-button">
44
44
-
<span>login</span>
45
45
-
</button>
38
38
+
<button
39
39
+
class="btn w-full my-2 mt-6"
40
40
+
type="submit"
41
41
+
id="login-button"
42
42
+
>
43
43
+
<span>login</span>
44
44
+
</button>
46
45
</form>
47
46
<p id="login-msg" class="error w-full"></p>
48
47
</main>
+1
-1
appview/state/state.go
Reviewed
···
100
100
}
101
101
102
102
log.Printf("successfully saved session for %s (%s)", atSession.Handle, atSession.Did)
103
103
-
http.Redirect(w, r, "/", http.StatusSeeOther)
103
103
+
s.pages.HxRedirect(w, "/")
104
104
return
105
105
}
106
106
}