diff --git a/src/app/main/action/login-form/login-form.component.ts b/src/app/main/action/login-form/login-form.component.ts index 07f2538300..a691402150 100644 --- a/src/app/main/action/login-form/login-form.component.ts +++ b/src/app/main/action/login-form/login-form.component.ts @@ -167,12 +167,12 @@ export class LoginFormComponent implements OnInit, AfterViewInit { const username = this.session.user.name; this._dspApiConnection.admin.usersEndpoint.getUserByUsername(username).subscribe( (userResponse: ApiResponseData) => { - // if user is only a member of one project, redirect them to that projects dashboard - if(userResponse.body.user.projects.length === 1) { + // if user is NOT a sysAdmin and only a member of one project, redirect them to that projects dashboard + if(!this.session.user.sysAdmin && userResponse.body.user.projects.length === 1) { this._router.navigateByUrl('/refresh', { skipLocationChange: true }).then( () => this._router.navigate(['/beta/project/' + userResponse.body.user.projects[0].shortcode]) ); - } else { // if user is a member of multiple projects, redirect them to the overview + } else { // if user is a sysAdmin or a member of multiple projects, redirect them to the overview this._router.navigateByUrl('/refresh', { skipLocationChange: true }).then( () => this._router.navigate(['/']) );