Commit 208eb7d6 authored by Phil Hughes's avatar Phil Hughes

Added dispatcher imports for sessions route

parent 68cc9ea2
...@@ -23,7 +23,6 @@ import GLForm from './gl_form'; ...@@ -23,7 +23,6 @@ import GLForm from './gl_form';
import Shortcuts from './shortcuts'; import Shortcuts from './shortcuts';
import ShortcutsNavigation from './shortcuts_navigation'; import ShortcutsNavigation from './shortcuts_navigation';
import ShortcutsIssuable from './shortcuts_issuable'; import ShortcutsIssuable from './shortcuts_issuable';
import U2FAuthenticate from './u2f/authenticate';
import Diff from './diff'; import Diff from './diff';
import SearchAutocomplete from './search_autocomplete'; import SearchAutocomplete from './search_autocomplete';
import Activities from './activities'; import Activities from './activities';
...@@ -537,18 +536,15 @@ import Activities from './activities'; ...@@ -537,18 +536,15 @@ import Activities from './activities';
} }
switch (path[0]) { switch (path[0]) {
case 'sessions': case 'sessions':
import('./pages/sessions')
.then(callDefault)
.catch(fail);
break;
case 'omniauth_callbacks': case 'omniauth_callbacks':
if (!gon.u2f) break; import('./pages/omniauth_callbacks')
const u2fAuthenticate = new U2FAuthenticate( .then(callDefault)
$('#js-authenticate-u2f'), .catch(fail);
'#js-login-u2f-form', break;
gon.u2f,
document.querySelector('#js-login-2fa-device'),
document.querySelector('.js-2fa-form'),
);
u2fAuthenticate.start();
// needed in rspec
gl.u2fAuthenticate = u2fAuthenticate;
case 'admin': case 'admin':
import('./pages/admin') import('./pages/admin')
.then(callDefault) .then(callDefault)
...@@ -598,10 +594,6 @@ import Activities from './activities'; ...@@ -598,10 +594,6 @@ import Activities from './activities';
break; break;
} }
break; break;
case 'dashboard':
case 'root':
new UserCallout();
break;
case 'profiles': case 'profiles':
import('./pages/profiles/index/') import('./pages/profiles/index/')
.then(callDefault) .then(callDefault)
......
import initU2F from '../../shared/sessions/u2f';
export default () => {
initU2F();
};
import initU2F from '../../shared/sessions/u2f';
export default () => {
initU2F();
};
import U2FAuthenticate from '../../u2f/authenticate';
export default () => {
if (!gon.u2f) return;
const u2fAuthenticate = new U2FAuthenticate(
$('#js-authenticate-u2f'),
'#js-login-u2f-form',
gon.u2f,
document.querySelector('#js-login-2fa-device'),
document.querySelector('.js-2fa-form'),
);
u2fAuthenticate.start();
// needed in rspec
gl.u2fAuthenticate = u2fAuthenticate;
};
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