Skip to content
Snippets Groups Projects
Unverified Commit f42313c8 authored by Andrej Shadura's avatar Andrej Shadura
Browse files

Repeat SSO user lookup by emails in username/nickname fields


When logging in with e.g. OpenID Connect/Azure, two email addresses
may be provided, one in "email" field and another in "username" or
"nickname". Since this is exactly the opposite of what the separate
Azure backend does, migration from Azure to OpenID Connect/Azure
needs to try both emails which may be different.

Signed-off-by: Andrej Shadura's avatarAndrej Shadura <andrew.shadura@collabora.co.uk>
parent 34fe064f
No related branches found
No related tags found
No related merge requests found
Pipeline #43781 passed
...@@ -233,6 +233,17 @@ class User < ApplicationRecord ...@@ -233,6 +233,17 @@ class User < ApplicationRecord
return user return user
end end
username = auth['username'] || auth['nickname']
if username.include? '@'
user = find_by_email(username)
if user
user.mark_login!
return user
end
end
end end
end end
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment