MCPcopy Index your code
hub / github.com/codecombat/codecombat / loginNavigate

Function loginNavigate

app/views/core/AuthModal.js:368–399  ·  view source on GitHub ↗
(subModalContinue)

Source from the content-addressed store, hash-verified

366}
367
368var loginNavigate = function (subModalContinue) {
369 if (window.nextURL) {
370 window.location.href = window.nextURL
371 return
372 }
373
374 if (!me.isAdmin()) {
375 if (me.isAPIClient()) {
376 application.router.navigate('/partner-dashboard', { trigger: true })
377 } else if (me.isStudent()) {
378 application.router.navigate('/students', { trigger: true })
379 } else if (me.isTeacher()) {
380 if (me.isSchoolAdmin()) {
381 // todo: unify?
382 if (utils.isCodeCombat) {
383 application.router.navigate('/teachers/licenses', { trigger: true })
384 } else {
385 application.router.navigate('/school-administrator', { trigger: true })
386 }
387 } else {
388 application.router.navigate('/teachers/classes', { trigger: true })
389 }
390 } else if (me.isParentHome()) {
391 const routeStr = me.hasNoVerifiedChild() ? '/parents/add-another-child' : '/parents/dashboard'
392 application.router.navigate(routeStr, { trigger: true })
393 }
394 } else if (subModalContinue) {
395 storage.save('sub-modal-continue', subModalContinue)
396 }
397
398 return window.location.reload()
399}
400
401function __guardMethod__ (obj, methodName, transform) {
402 if (typeof obj !== 'undefined' && obj !== null && typeof obj[methodName] === 'function') {

Callers 3

onSubmitFormMethod · 0.85
successMethod · 0.85
mergeLoginMethod · 0.85

Calls 10

isAdminMethod · 0.80
isAPIClientMethod · 0.80
navigateMethod · 0.80
isStudentMethod · 0.80
isTeacherMethod · 0.80
isSchoolAdminMethod · 0.80
isParentHomeMethod · 0.80
hasNoVerifiedChildMethod · 0.80
reloadMethod · 0.80
saveMethod · 0.45

Tested by

no test coverage detected