mirror of
https://github.com/openSUSE/osem.git
synced 2026-08-13 19:54:02 +00:00
added email presence validation to openid
closes #1658 added test for openid fixed robocup offences written tests for email presence validation minor changes shifted omniauth callback tests to rspec controllers fixed linting bug minor changes minor changes
This commit is contained in:
parent
2df8adea69
commit
83053f4626
5 changed files with 62 additions and 1 deletions
|
|
@ -11,6 +11,11 @@ module Users
|
|||
|
||||
def handle(provider)
|
||||
auth_hash = request.env['omniauth.auth']
|
||||
unless auth_hash.info.email.present?
|
||||
flash[:error] = "Email field is missing in your #{provider} account"
|
||||
redirect_to new_user_registration_path
|
||||
return
|
||||
end
|
||||
username = auth_hash.info.email.split('@')[0]
|
||||
openid = Openid.find_for_oauth(auth_hash) # Get or create openid
|
||||
# If openid exists and is associated with a user, sign in with associated user,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue