mirror of
https://github.com/discourse/discourse.git
synced 2025-05-22 17:13:25 +08:00
fix open id so it creates records properly
This commit is contained in:
@ -29,10 +29,22 @@ class Auth::OpenIdAuthenticator < Auth::Authenticator
|
|||||||
|
|
||||||
result.user = user_open_id.try(:user)
|
result.user = user_open_id.try(:user)
|
||||||
result.extra_data = {
|
result.extra_data = {
|
||||||
openid_url: identity_url
|
openid_url: identity_url,
|
||||||
|
# note email may change by the time after_create_account runs
|
||||||
|
email: email
|
||||||
}
|
}
|
||||||
result.email_valid = @opts[:trusted]
|
result.email_valid = @opts[:trusted]
|
||||||
|
|
||||||
result
|
result
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def after_create_account(user, auth)
|
||||||
|
data = auth[:extra_data]
|
||||||
|
UserOpenId.create(
|
||||||
|
user_id: user.id,
|
||||||
|
url: data[:openid_url],
|
||||||
|
email: data[:email],
|
||||||
|
active: true
|
||||||
|
)
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
Reference in New Issue
Block a user