Commit 269594bf authored by Jacopo's avatar Jacopo

Fix Shows signin tab after new user email confirmation

When a new user confirm his email the signin tab is correctly shown.
parent 50a64953
/* eslint no-param-reassign: ["error", { "props": false }]*/
/* eslint no-new: "off" */
import AccessorUtilities from '~/lib/utils/accessor';
/**
......@@ -11,6 +9,10 @@ export default class SigninTabsMemoizer {
this.currentTabKey = currentTabKey;
this.tabSelector = tabSelector;
this.isLocalStorageAvailable = AccessorUtilities.isLocalStorageAccessSafe();
// sets selected tab if given as hash tag
if (window.location.hash) {
this.saveData(window.location.hash);
}
this.bootstrap();
}
......
......@@ -17,7 +17,7 @@ class ConfirmationsController < Devise::ConfirmationsController
else
Gitlab::AppLogger.info("Email Confirmed: username=#{resource.username} email=#{resource.email} ip=#{request.remote_ip}")
flash[:notice] += " Please sign in."
new_session_path(:user)
new_session_path(:user, anchor: 'login-pane')
end
end
......
......@@ -8,7 +8,7 @@
.login-body
= render 'devise/sessions/new_ldap', server: server
- if password_authentication_enabled_for_web?
.login-box.tab-pane{ id: 'ldap-standard', role: 'tabpanel' }
.login-box.tab-pane{ id: 'login-pane', role: 'tabpanel' }
.login-body
= render 'devise/sessions/new_base'
......
......@@ -7,7 +7,7 @@
= link_to server['label'], "##{server['provider_name']}", 'data-toggle' => 'tab'
- if password_authentication_enabled_for_web?
%li
= link_to 'Standard', '#ldap-standard', 'data-toggle' => 'tab'
= link_to 'Standard', '#login-pane', 'data-toggle' => 'tab'
- if allow_signup?
%li
= link_to 'Register', '#register-pane', 'data-toggle' => 'tab'
---
title: Shows signin tab after new user email confirmation
merge_request: 16174
author: Jacopo Beschi @jacopo-beschi
type: fixed
......@@ -53,6 +53,13 @@ import SigninTabsMemoizer from '~/pages/sessions/new/signin_tabs_memoizer';
expect(memo.readData()).toEqual('#standard');
});
it('overrides last selected tab with hash tag when given', () => {
window.location.hash = '#ldap';
createMemoizer();
expect(memo.readData()).toEqual('#ldap');
});
describe('class constructor', () => {
beforeEach(() => {
memo = createMemoizer();
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment