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:
Marco Hofstetter
2023-06-21 17:36:56 -07:00
committed by Will Norris
parent 2b98aed2ea
commit e6a9c75f4f
+4
View File
@@ -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