mirror of
https://github.com/internetee/registry.git
synced 2025-07-21 10:16:01 +02:00
Merge branch 'master' of github.com:domify/registry
This commit is contained in:
commit
dcfafdc2d7
4 changed files with 15 additions and 3 deletions
|
@ -4,7 +4,7 @@
|
||||||
|
|
||||||
25.05.2015
|
25.05.2015
|
||||||
|
|
||||||
* Added iptables counter commant to application-example.yml
|
* Added iptables counter command to application-example.yml
|
||||||
* Add update application.yml with correct `sk_digi_doc_service_endpoint`
|
* Add update application.yml with correct `sk_digi_doc_service_endpoint`
|
||||||
|
|
||||||
22.05.2015
|
22.05.2015
|
||||||
|
|
|
@ -49,9 +49,10 @@ class Registrant::SessionsController < Devise::SessionsController
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
|
||||||
@user = find_user_by_idc(response.user_id_code)
|
@user = RegistrantUser.find_or_create_by_mid_data(response)
|
||||||
|
|
||||||
if @user.persisted?
|
if @user.persisted?
|
||||||
|
session[:user_country] = response.user_country
|
||||||
session[:user_id_code] = response.user_id_code
|
session[:user_id_code] = response.user_id_code
|
||||||
session[:mid_session_code] = client.session_code
|
session[:mid_session_code] = client.session_code
|
||||||
render json: { message: t(:check_your_phone_for_confirmation_code) }, status: :ok
|
render json: { message: t(:check_your_phone_for_confirmation_code) }, status: :ok
|
||||||
|
@ -72,7 +73,8 @@ class Registrant::SessionsController < Devise::SessionsController
|
||||||
when 'OUTSTANDING_TRANSACTION'
|
when 'OUTSTANDING_TRANSACTION'
|
||||||
render json: { message: t(:check_your_phone_for_confirmation_code) }, status: :ok
|
render json: { message: t(:check_your_phone_for_confirmation_code) }, status: :ok
|
||||||
when 'USER_AUTHENTICATED'
|
when 'USER_AUTHENTICATED'
|
||||||
@user = find_user_by_idc(session[:user_id_code])
|
@user = RegistrantUser.find_by(registrant_ident: "#{session[:user_country]}-#{session[:user_id_code]}")
|
||||||
|
|
||||||
sign_in @user
|
sign_in @user
|
||||||
flash[:notice] = t(:welcome)
|
flash[:notice] = t(:welcome)
|
||||||
flash.keep(:notice)
|
flash.keep(:notice)
|
||||||
|
|
|
@ -29,5 +29,13 @@ class RegistrantUser < User
|
||||||
|
|
||||||
u
|
u
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def find_or_create_by_mid_data(response)
|
||||||
|
u = where(registrant_ident: "#{response.user_country}-#{response.user_id_code}").first_or_create
|
||||||
|
u.username = "#{response.user_givenname} #{response.user_surname}"
|
||||||
|
u.save
|
||||||
|
|
||||||
|
u
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -2,5 +2,7 @@
|
||||||
.form-signin.col-md-6.center-block.text-center
|
.form-signin.col-md-6.center-block.text-center
|
||||||
%h2.form-signin-heading.text-center= t(:log_in)
|
%h2.form-signin-heading.text-center= t(:log_in)
|
||||||
%hr
|
%hr
|
||||||
|
= link_to '/registrant/login/mid' do
|
||||||
|
= image_tag 'mid.gif'
|
||||||
= link_to '/registrant/id', method: :post do
|
= link_to '/registrant/id', method: :post do
|
||||||
= image_tag 'id_card.gif'
|
= image_tag 'id_card.gif'
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue