Login does not work, $kirby->user($username) always returns null

Hi all,

i don’t know whats going worng.

$kirby->user(‘admin’); always returns null. I have tried it in my template and controller with no success.

Also also tried other usernames, also null:

Any ideas?

admin is a user role, not a user name => $kirby->user('john@example.com'). The parameter should be a user ID, so either email or name

Hi texnixe,

it works with the email address but none of my usernames work. Username != the user name i added in the backend?

I wasn’t sure, maybe it only works with the email, at least that is the only parameter that must be unique, so that would make sense.

okay, thank you!