[Fix #1479] Sanitize User email before validation
This commit is contained in:
parent
8731f7c63b
commit
a00114d03d
1 changed files with 4 additions and 1 deletions
|
@ -1,4 +1,7 @@
|
|||
class User < ApplicationRecord
|
||||
include CredentialsSyncableConcern
|
||||
include EmailSanitizableConcern
|
||||
|
||||
enum loged_in_with_france_connect: {
|
||||
particulier: 'particulier',
|
||||
entreprise: 'entreprise'
|
||||
|
@ -18,7 +21,7 @@ class User < ApplicationRecord
|
|||
delegate :given_name, :family_name, :email_france_connect, :gender, :birthdate, :birthplace, :france_connect_particulier_id, to: :france_connect_information
|
||||
accepts_nested_attributes_for :france_connect_information
|
||||
|
||||
include CredentialsSyncableConcern
|
||||
before_validation -> { sanitize_email(:email) }
|
||||
|
||||
def self.find_for_france_connect email, siret
|
||||
user = User.find_by(email: email)
|
||||
|
|
Loading…
Reference in a new issue