fix: properly redirect to login page if access to space without user
This commit is contained in:
parent
669c01716c
commit
0a2ab751a5
1 changed files with 1 additions and 1 deletions
|
|
@ -16,7 +16,7 @@ func RequireSpaceAccess(spaceService *service.SpaceService) func(http.HandlerFun
|
|||
user := ctxkeys.User(r.Context())
|
||||
if user == nil {
|
||||
// This should be caught by RequireAuth first, but as a safeguard.
|
||||
http.Error(w, "Unauthorized", http.StatusUnauthorized)
|
||||
redirect(w, r, "/auth", http.StatusSeeOther)
|
||||
return
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue