-
-
Notifications
You must be signed in to change notification settings - Fork 54
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add a block page to oidc on invallid credentials, fix inifinite login…
… redirect
- Loading branch information
yusing
committed
Feb 26, 2025
1 parent
485aa0f
commit a4d99b5
Showing
5 changed files
with
52 additions
and
8 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
package auth | ||
|
||
import ( | ||
"html/template" | ||
"net/http" | ||
|
||
_ "embed" | ||
) | ||
|
||
//go:embed block_page.html | ||
var blockPageHTML string | ||
|
||
var blockPageTemplate = template.Must(template.New("block_page").Parse(blockPageHTML)) | ||
|
||
func WriteBlockPage(w http.ResponseWriter, status int, error string, logoutURL string) { | ||
w.Header().Set("Content-Type", "text/html; charset=utf-8") | ||
blockPageTemplate.Execute(w, map[string]string{ | ||
"StatusText": http.StatusText(status), | ||
"Error": error, | ||
"LogoutURL": logoutURL, | ||
}) | ||
} |
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,14 @@ | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="UTF-8"> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | ||
|
||
<title>Access Denied</title> | ||
</head> | ||
<body> | ||
<h1>{{.StatusText}}</h1> | ||
<p>{{.Error}}</p> | ||
<a href="{{.LogoutURL}}">Logout</a> | ||
</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
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