Skip to content
Snippets Groups Projects
Commit 09868ea5 authored by pabois's avatar pabois
Browse files

wip registration extranets

parent 99cd634d
No related branches found
No related tags found
No related merge requests found
......@@ -50,4 +50,9 @@ class Users::RegistrationsController < Devise::RegistrationsController
def configure_account_update_params
devise_parameter_sanitizer.permit(:account_update, keys: [:mobile_phone, :language_id, :first_name, :last_name, :picture, :picture_infos, :picture_delete])
end
def sign_up_params
devise_parameter_sanitized = devise_parameter_sanitizer.sanitize(:sign_up)
current_mode == 'extranet' ? devise_parameter_sanitized.merge(extranet_to_validate: current_extranet) : devise_parameter_sanitized
end
end
......@@ -56,6 +56,7 @@
#
class User < ApplicationRecord
include WithAvatar
include WithExtranet
include WithUniversity
include WithAuthentication
include WithOmniauth
......
module User::WithExtranet
extend ActiveSupport::Concern
included do
attr_accessor :extranet_to_validate
validate :extranet_access, unless: -> { extranet_to_validate.blank? }
private
def extranet_access
# do extranet_to_validate alumni include current email?
# TODO
# errors.add :email, 'n est pas autorisé'
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