-
Notifications
You must be signed in to change notification settings - Fork 2
/
login.tpl.go
115 lines (109 loc) · 2.05 KB
/
login.tpl.go
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
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
package integration
import "html/template"
type LoginPageData struct {
// encoded lnurl string
Encoded string
// data uri string
DataUri template.URL
// cancel url
CancelUrl string
}
var HomeTpl = template.Must(template.New("home").Parse(`
<!DOCTYPE html>
<html lang="en">
<body>
{{ if . }}
<p> You are authenticated. To logout, go <a href="/logout"> here </a>
{{ else }}
<p> You are not authenticated. To login, go <a href="/login"> here </a>
{{ end }}
</body>
</html>
`))
var LoginPage = template.Must(template.New("login").Parse(`
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Login with lnurl-auth</title>
<style>
html, body {
width: 100%;
height: 100%;
color: #fff;
font-family: sans;
background: #222;
margin: 0;
}
h1 {
margin: 0 0 .5rem 0;
}
p {
font-weight: 100;
line-height: 150%;
margin: 0 0 1rem 0;
}
#content {
display: flex;
height: 100%;
text-align: center;
}
.wrap {
width: 80%;
max-width: 24rem;
align-self: center;
margin: 0 auto;
}
#qrcode {
display: block;
width: 16rem;
height: 16rem;
margin: 0 auto;
}
#qrcode img {
display: block;
width: 100%;
}
.button {
cursor: pointer;
color: #fff;
font-size: 1.1rem;
line-height: 1.8rem;
background: #c95b59;
border: none;
outline: none;
border-radius: .4rem;
opacity: .7;
padding: .4rem .8rem;
}
a.button,
a.button:hover {
text-decoration: none;
}
.button:hover {
opacity: 1;
}
#buttons {
display: block;
margin-top: 1rem;
}
</style>
<meta http-equiv="refresh" content="8">
</head>
<body>
<div id="content">
<div class="wrap">
<h1>Login with lnurl-auth</h1>
<p>Scan the QR code with an app that supports lnurl-auth</p>
<a id="qrcode" href="lightning:{{.Encoded}}"><img src="{{.DataUri}}"></a>
<div id="buttons">
{{if .CancelUrl }}
<a href="{{.CancelUrl}}" class="button">Cancel</a>
{{end}}
</div>
</div>
</div>
</body>
</html>
`))