mirror of
https://github.com/go-shiori/shiori.git
synced 2024-11-10 17:36:02 +08:00
If already logged in, redirect to main page
This commit is contained in:
parent
07f0d333ec
commit
b0796d3ed3
1 changed files with 7 additions and 0 deletions
|
@ -120,6 +120,13 @@ func serveIndexPage(w http.ResponseWriter, r *http.Request, ps httprouter.Params
|
|||
}
|
||||
|
||||
func serveLoginPage(w http.ResponseWriter, r *http.Request, ps httprouter.Params) {
|
||||
// Check token
|
||||
err := checkToken(r)
|
||||
if err == nil {
|
||||
redirectPage(w, r, "/")
|
||||
return
|
||||
}
|
||||
|
||||
asset, _ := assets.ReadFile("login.html")
|
||||
w.Header().Set("Content-Type", "text/html")
|
||||
buffer := bytes.NewBuffer(asset)
|
||||
|
|
Loading…
Reference in a new issue