1
0
Fork 0
mirror of https://github.com/binwiederhier/ntfy.git synced 2025-06-16 09:33:18 +02:00

Associate messages with a user

This commit is contained in:
binwiederhier 2022-12-19 21:42:36 -05:00
parent 84785b7a60
commit 2b78a8cb51
7 changed files with 71 additions and 41 deletions

View file

@ -75,19 +75,18 @@ func (s *Server) handleAccountGet(w http.ResponseWriter, r *http.Request, v *vis
Code: v.user.Plan.Code,
Upgradable: v.user.Plan.Upgradable,
}
} else if v.user.Role == auth.RoleAdmin {
response.Plan = &apiAccountPlan{
Code: string(auth.PlanUnlimited),
Upgradable: false,
}
} else {
if v.user.Role == auth.RoleAdmin {
response.Plan = &apiAccountPlan{
Code: string(auth.PlanUnlimited),
Upgradable: false,
}
} else {
response.Plan = &apiAccountPlan{
Code: string(auth.PlanDefault),
Upgradable: true,
}
response.Plan = &apiAccountPlan{
Code: string(auth.PlanDefault),
Upgradable: true,
}
}
} else {
response.Username = auth.Everyone
response.Role = string(auth.RoleAnonymous)