mirror of
https://github.com/internetee/registry.git
synced 2025-08-06 09:45:11 +02:00
Improve registrar sessions specs
registry-240
This commit is contained in:
parent
576c09b00d
commit
2643df8d21
7 changed files with 43 additions and 13 deletions
|
@ -101,12 +101,6 @@ class Registrar::SessionsController < Devise::SessionsController
|
|||
endpoint = "#{ENV['sk_digi_doc_service_endpoint']}"
|
||||
client = Digidoc::Client.new(endpoint)
|
||||
|
||||
if Rails.env.test? && phone == "123"
|
||||
@user = ApiUser.find_by(identity_code: "14212128025")
|
||||
sign_in(@user, event: :authentication)
|
||||
return redirect_to registrar_root_url
|
||||
end
|
||||
|
||||
# country_codes = {'+372' => 'EST'}
|
||||
phone.gsub!('+372', '')
|
||||
response = client.authenticate(
|
||||
|
|
|
@ -8,13 +8,13 @@
|
|||
- error_class = f.object.errors.any? ? 'has-error' : ''
|
||||
%div{class: error_class}
|
||||
= f.text_field :tag, class: 'form-control', placeholder: t(:username), required: true
|
||||
= f.password_field :password, class: 'form-control',
|
||||
= f.password_field :password, class: 'form-control',
|
||||
autocomplete: 'off', placeholder: t(:password), required: true
|
||||
|
||||
%button.btn.btn-lg.btn-primary.btn-block{:type => 'submit'}= t(:log_in)
|
||||
%button.btn.btn-lg.btn-primary.btn-block{:type => 'submit'}= t('.login_btn')
|
||||
|
||||
%hr
|
||||
= link_to '/registrar/login/mid' do
|
||||
= link_to '/registrar/login/mid', id: 'login-with-mobile-id-btn' do
|
||||
= image_tag 'mid.gif'
|
||||
= link_to '/registrar/id', method: :post do
|
||||
= image_tag 'id_card.gif'
|
||||
|
|
|
@ -2,11 +2,11 @@
|
|||
.form-signin.col-md-4.center-block.text-center
|
||||
%h2.form-signin-heading.text-center= t(:log_in_with_mid)
|
||||
%hr
|
||||
= form_for @user, url: registrar_mid_path, auto_html5_validation: false,
|
||||
= form_for @user, url: registrar_mid_path, auto_html5_validation: false,
|
||||
html: {class: 'form-signin'} do |f|
|
||||
= f.text_field :phone, class: 'form-control',
|
||||
= f.text_field :phone, class: 'form-control',
|
||||
placeholder: t(:phone_no), autocomplete: 'off', required: true
|
||||
%button.btn.btn-lg.btn-primary.btn-block.js-login{:type => 'submit'}= t(:log_in)
|
||||
%button.btn.btn-lg.btn-primary.btn-block.js-login{:type => 'submit'}= t('.login_btn')
|
||||
|
||||
- if ['development', 'alpha'].include?(Rails.env)
|
||||
%div.text-center
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue