Skip to content
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 10 additions & 5 deletions routers/api/packages/container/auth.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,16 @@ func (a *Auth) Verify(req *http.Request, w http.ResponseWriter, store auth.DataS
return nil, err
}

if uid == 0 {
return nil, nil
}
if uid == -1 {
return user_model.NewGhostUser(), nil
if uid <= 0 {
switch uid {
case -1:
return user_model.NewGhostUser(), nil
case -2:
return user_model.NewActionsUser(), nil
default:
log.Error("Invaild uid: %d", uid)
return nil, nil
}
}

u, err := user_model.GetUserByID(req.Context(), uid)
Expand Down