How do I check if it's the first time the user log...
# talk-kratos
f
How do I check if it's the first time the user login with whoAmi query ?
m
Don’t know if you can use that, but perhaps https://www.ory.sh/docs/reference/api#operation/adminListIdentitySessions with per_page=1 would let you check if the returned session’s ID matched the whoami session ID
(perpage=1 just so it doesn’t try and grab a million sessions for long-running users)
d
You could probably add a
has_logged_once
field in your identity schema and update it in a login webhook.
f
Thanks @dazzling-vase-23428 .How do I update it in login webhook after ?