This commit is contained in:
lbenedar
2026-03-06 15:37:31 +03:00
parent b6cdb2b860
commit 126ccfa715
5 changed files with 49 additions and 11 deletions

View File

@@ -42,5 +42,9 @@ func (app *application) decodePostForm(r *http.Request, snippetForm any) error {
}
func (app *application) isAuthenticated(r *http.Request) bool {
return app.sessionManager.Exists(r.Context(), "authenticatedUserID")
isAuthenticated, ok := r.Context().Value(isAuthenticatedContextKey).(bool)
if !ok {
return false
}
return isAuthenticated
}