mirror of
https://github.com/wahyd4/golink.git
synced 2026-08-08 21:01:05 +10:00
support tagged-devices in userExists in devmode
Even in dev mode, the user `tagged-devices` should not be reported as existing user. This allows editing & deleting links owned by `taggged-devices` in dev mode. Signed-off-by: Marco Hofstetter <marco.hofstetter@bluewin.ch>
This commit is contained in:
committed by
Will Norris
parent
2b98aed2ea
commit
e6a9c75f4f
@@ -565,6 +565,10 @@ var currentUser = func(r *http.Request) (string, error) {
|
||||
func userExists(ctx context.Context, login string) (bool, error) {
|
||||
const userTaggedDevices = "tagged-devices" // owner of tagged devices
|
||||
|
||||
if login == userTaggedDevices {
|
||||
return false, nil
|
||||
}
|
||||
|
||||
if devMode() {
|
||||
// in dev mode, just assume the user exists
|
||||
return true, nil
|
||||
|
||||
Reference in New Issue
Block a user