mirror of
https://github.com/rjNemo/auth
synced 2026-06-06 08:26:39 +00:00
15 lines
396 B
Go
15 lines
396 B
Go
package server
|
|
|
|
import "net/http"
|
|
|
|
func (s *Server) dashboardHandler() http.HandlerFunc {
|
|
return func(w http.ResponseWriter, r *http.Request) {
|
|
if !s.sessions.IsAuthenticated() {
|
|
w.WriteHeader(http.StatusUnauthorized)
|
|
s.render(w, "unauthorized.html", newUnauthorizedData("Sign in to continue."))
|
|
return
|
|
}
|
|
|
|
s.render(w, "in.html", PageData{Email: s.sessions.CurrentAccount()})
|
|
}
|
|
}
|