Skip to content

Commit 597a722

Browse files
author
Filipa Lacerda
committed
Merge branch 'dispatcher-ph-more' into 'master'
Added dispatcher imports for sessions route See merge request gitlab-org/gitlab-ce!16608
2 parents 9053854 + 208eb7d commit 597a722

File tree

4 files changed

+34
-16
lines changed

4 files changed

+34
-16
lines changed

app/assets/javascripts/dispatcher.js

+8-16
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@ import GLForm from './gl_form';
2323
import Shortcuts from './shortcuts';
2424
import ShortcutsNavigation from './shortcuts_navigation';
2525
import ShortcutsIssuable from './shortcuts_issuable';
26-
import U2FAuthenticate from './u2f/authenticate';
2726
import Diff from './diff';
2827
import SearchAutocomplete from './search_autocomplete';
2928
import Activities from './activities';
@@ -537,18 +536,15 @@ import Activities from './activities';
537536
}
538537
switch (path[0]) {
539538
case 'sessions':
539+
import('./pages/sessions')
540+
.then(callDefault)
541+
.catch(fail);
542+
break;
540543
case 'omniauth_callbacks':
541-
if (!gon.u2f) break;
542-
const u2fAuthenticate = new U2FAuthenticate(
543-
$('#js-authenticate-u2f'),
544-
'#js-login-u2f-form',
545-
gon.u2f,
546-
document.querySelector('#js-login-2fa-device'),
547-
document.querySelector('.js-2fa-form'),
548-
);
549-
u2fAuthenticate.start();
550-
// needed in rspec
551-
gl.u2fAuthenticate = u2fAuthenticate;
544+
import('./pages/omniauth_callbacks')
545+
.then(callDefault)
546+
.catch(fail);
547+
break;
552548
case 'admin':
553549
import('./pages/admin')
554550
.then(callDefault)
@@ -598,10 +594,6 @@ import Activities from './activities';
598594
break;
599595
}
600596
break;
601-
case 'dashboard':
602-
case 'root':
603-
new UserCallout();
604-
break;
605597
case 'profiles':
606598
import('./pages/profiles/index/')
607599
.then(callDefault)
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
import initU2F from '../../shared/sessions/u2f';
2+
3+
export default () => {
4+
initU2F();
5+
};
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
import initU2F from '../../shared/sessions/u2f';
2+
3+
export default () => {
4+
initU2F();
5+
};
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
import U2FAuthenticate from '../../u2f/authenticate';
2+
3+
export default () => {
4+
if (!gon.u2f) return;
5+
6+
const u2fAuthenticate = new U2FAuthenticate(
7+
$('#js-authenticate-u2f'),
8+
'#js-login-u2f-form',
9+
gon.u2f,
10+
document.querySelector('#js-login-2fa-device'),
11+
document.querySelector('.js-2fa-form'),
12+
);
13+
u2fAuthenticate.start();
14+
// needed in rspec
15+
gl.u2fAuthenticate = u2fAuthenticate;
16+
};

0 commit comments

Comments
 (0)