-
Notifications
You must be signed in to change notification settings - Fork 200
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Change authentication success page more descriptive (#312)
* Refactor: rename to authcode_browser.go * Change authentication success page more descriptive
- Loading branch information
Showing
6 changed files
with
62 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
package templates | ||
|
||
// AuthCodeBrowserSuccessHTML is the success page on browser based authentication. | ||
const AuthCodeBrowserSuccessHTML = ` | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="UTF-8"> | ||
<title>Authenticated</title> | ||
<script> | ||
window.close() | ||
</script> | ||
<style> | ||
body { | ||
background-color: #eee; | ||
margin: 0; | ||
padding: 0; | ||
font-family: sans-serif; | ||
} | ||
.placeholder { | ||
margin: 5em; | ||
padding: 2em; | ||
background-color: #fff; | ||
border-radius: 1em; | ||
} | ||
</style> | ||
</head> | ||
<body> | ||
<div class="placeholder"> | ||
<h1>Authenticated</h1> | ||
<p>You have logged in to the cluster. You can close this window.</p> | ||
</div> | ||
</body> | ||
</html> | ||
` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
package main | ||
|
||
import ( | ||
"log" | ||
"net/http" | ||
|
||
"github.com/int128/kubelogin/pkg/templates" | ||
) | ||
|
||
func main() { | ||
http.HandleFunc("/AuthCodeBrowserSuccessHTML", func(w http.ResponseWriter, r *http.Request) { | ||
w.Header().Add("content-type", "text/html") | ||
_, _ = w.Write([]byte(templates.AuthCodeBrowserSuccessHTML)) | ||
}) | ||
log.Printf("http://localhost:8000/AuthCodeBrowserSuccessHTML") | ||
log.Fatal(http.ListenAndServe("127.0.0.1:8000", nil)) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
// Package templates provides templates such as HTML and messages. | ||
// | ||
// You can preview HTML pages by running httpserver package. | ||
// go run ./httpserver | ||
// | ||
package templates |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.