Skip to content

Commit e48f9ce

Browse files
authored
Improve default authorization success page (#38)
1 parent c95f179 commit e48f9ce

File tree

1 file changed

+32
-1
lines changed

1 file changed

+32
-1
lines changed

oauth2cli.go

Lines changed: 32 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,38 @@ import (
1414
var noopMiddleware = func(h http.Handler) http.Handler { return h }
1515

1616
// DefaultLocalServerSuccessHTML is a default response body on authorization success.
17-
const DefaultLocalServerSuccessHTML = `<html><body>OK<script>window.close()</script></body></html>`
17+
const DefaultLocalServerSuccessHTML = `
18+
<!DOCTYPE html>
19+
<html lang="en">
20+
<head>
21+
<meta charset="UTF-8">
22+
<title>Authorized</title>
23+
<script>
24+
window.close()
25+
</script>
26+
<style>
27+
body {
28+
background-color: #eee;
29+
margin: 0;
30+
padding: 0;
31+
font-family: sans-serif;
32+
}
33+
.placeholder {
34+
margin: 2em;
35+
padding: 2em;
36+
background-color: #fff;
37+
border-radius: 1em;
38+
}
39+
</style>
40+
</head>
41+
<body>
42+
<div class="placeholder">
43+
<h1>Authorized</h1>
44+
<p>You can close this window.</p>
45+
</div>
46+
</body>
47+
</html>
48+
`
1849

1950
// Config represents a config for GetToken.
2051
type Config struct {

0 commit comments

Comments
 (0)