Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -77,9 +77,13 @@
</div>
<div class="form-group">
<label for="profile">Rol</label>
<select [(ngModel)]="user.authorities" class="form-control" id="profile" multiple name="authority">
<select [(ngModel)]="user.authorities" required class="form-control" id="profile" multiple name="authority">
<option *ngFor="let authority of authorities" [value]="authority">{{authority}}</option>
</select>
<small *ngIf="user.authorities && user.authorities.length === 0"
class="form-text text-danger">
This field is required. You must select a role.
</small>
</div>

</form>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
<i class="icon-lock2 text-muted"></i>
</div>
<input [placeholder]="'login.password' | translate" class="form-control"
[minlength]="'4'"
formControlName="password"
type="password">
</div>
Expand Down Expand Up @@ -67,7 +68,7 @@
</div>

<!-- /content area -->
<div *ngIf="logged" class="content d-flex justify-content-center align-items-center h-100 w-100">
<div *appHasAnyAuthority="roles" class="content d-flex justify-content-center align-items-center h-100 w-100">
<app-utm-spinner [height]="'35px'" [label]="'Loading modules...'" [loading]="true"
[width]="'35px'"></app-utm-spinner>
</div>
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import {LoginService} from '../../../../core/login/login.service';
import {UtmToastService} from '../../../alert/utm-toast.service';
import {MenuBehavior} from '../../../behaviors/menu.behavior';
import {ThemeChangeBehavior} from '../../../behaviors/theme-change.behavior';
import {ADMIN_DEFAULT_EMAIL, ADMIN_ROLE, DEMO_URL} from '../../../constants/global.constant';
import {ADMIN_DEFAULT_EMAIL, ADMIN_ROLE, DEMO_URL, USER_ROLE} from '../../../constants/global.constant';
import {stringParamToQueryParams} from '../../../util/query-params-to-filter.util';
import {PasswordResetInitComponent} from '../password-reset/init/password-reset-init.component';

Expand All @@ -27,6 +27,7 @@ export class LoginComponent implements OnInit, AfterViewInit {
credentials: any;
formLogin: FormGroup;
logged = false;
roles = [ADMIN_ROLE, USER_ROLE];
startLogin = false;
isInDemo: boolean;
loadingAuth = true;
Expand Down Expand Up @@ -171,11 +172,14 @@ export class LoginComponent implements OnInit, AfterViewInit {
? '/getting-started' : '/dashboard/overview';
this.router.navigate([redirectTo])
.then(() => this.spinner.hide());
} else {
this.logged = false;
this.utmToast.showError('Login error', 'User without privileges.');
}
});
}

startInternalNavigation(){
startInternalNavigation() {
this.router.navigate(['/dashboard/overview']);
}

Expand Down