[Library]: Remove errors from user-info
git-svn-id: https://svn.driver.research-infrastructures.eu/driver/dnet40/modules/uoa-services-library/trunk/ng-openaire-library/src/app@57439 d315682c-612b-4755-9ff5-7f18f6832af3
This commit is contained in:
parent
bee36bfc13
commit
f729962ed2
|
@ -1,13 +1,12 @@
|
||||||
import {Component, Inject, Input, Optional} from '@angular/core';
|
import {Component, Input} from '@angular/core';
|
||||||
import {ActivatedRoute, Router} from '@angular/router';
|
import {ActivatedRoute, Router} from '@angular/router';
|
||||||
import {Meta, Title} from '@angular/platform-browser';
|
import {Title, Meta} from '@angular/platform-browser';
|
||||||
|
|
||||||
import {Session, User} from './utils/helper.class';
|
import {User, Session} from './utils/helper.class';
|
||||||
import {RouterHelper} from '../utils/routerHelper.class';
|
import {RouterHelper} from '../utils/routerHelper.class';
|
||||||
|
|
||||||
import {EnvProperties} from '../utils/properties/env-properties';
|
import {EnvProperties} from '../utils/properties/env-properties';
|
||||||
import {UserManagementService} from "../services/user-management.service";
|
import {UserManagementService} from "../services/user-management.service";
|
||||||
import {RESPONSE} from "@nguniversal/express-engine/tokens";
|
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'user',
|
selector: 'user',
|
||||||
|
@ -33,8 +32,7 @@ export class UserComponent {
|
||||||
private route: ActivatedRoute,
|
private route: ActivatedRoute,
|
||||||
private _meta: Meta,
|
private _meta: Meta,
|
||||||
private _title: Title,
|
private _title: Title,
|
||||||
private userManagementsService: UserManagementService,
|
private userManagementsService: UserManagementService) {
|
||||||
@Optional() @Inject(RESPONSE) private response: any) {
|
|
||||||
|
|
||||||
var title = "OpenAIRE | Login";
|
var title = "OpenAIRE | Login";
|
||||||
this._title.setTitle(title);
|
this._title.setTitle(title);
|
||||||
|
@ -60,17 +58,6 @@ export class UserComponent {
|
||||||
this.errorMessage = "";
|
this.errorMessage = "";
|
||||||
if (this.loggedIn && this.errorCode == '1') {
|
if (this.loggedIn && this.errorCode == '1') {
|
||||||
this.redirect();
|
this.redirect();
|
||||||
} else {
|
|
||||||
if (this.errorCode == '1') {
|
|
||||||
this.response.statusCode = 403;
|
|
||||||
this.response.statusMessage = '403 - Forbidden';
|
|
||||||
} else if (this.errorCode == '2' || this.errorCode == '3' || this.errorCode == '5') {
|
|
||||||
this.response.statusCode = 401;
|
|
||||||
this.response.statusMessage = '401 - Unauthorized';
|
|
||||||
} else {
|
|
||||||
this.response.statusCode = 400;
|
|
||||||
this.response.statusMessage = '400 - Bad Request';
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in New Issue