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

#1

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?

0 Likes

#2

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

0 Likes

#3

Hi texnixe,

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

0 Likes

#4

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.

0 Likes

#5

okay, thank you!

0 Likes