Merge branch 'master' of gitlab.eudat.eu:dmp/OpenAIRE-EUDAT-DMP-service-pilot
This commit is contained in:
commit
7e19087bb6
|
@ -11,10 +11,10 @@ import { MainSignInComponent } from './login/main-sign-in/main-sign-in.component
|
|||
|
||||
const appRoutes: Routes = [
|
||||
{ path: 'dynamic-form', component: DynamicFormComponent, canActivate: [AuthGuard] },
|
||||
{ path: 'login-page', component: MainSignInComponent},
|
||||
{ path: 'login', component: MainSignInComponent},
|
||||
{ path: 'projects', component: ProjectsComponent},
|
||||
{ path: 'dmps', component: DmpComponent},
|
||||
{ path: '', redirectTo: '/login-page', pathMatch: 'full' },
|
||||
{ path: '', redirectTo: '/login', pathMatch: 'full' },
|
||||
{ path: '**', component: PageNotFoundComponent },
|
||||
{
|
||||
path: '',
|
||||
|
|
|
@ -29,12 +29,12 @@ export class AppComponent {
|
|||
|
||||
login(){
|
||||
//redirect to login page
|
||||
this.router.navigate(['/login-page'], { queryParams: { /*returnUrl: this.state.url*/ }});
|
||||
this.router.navigate(['/login'], { queryParams: { /*returnUrl: this.state.url*/ }});
|
||||
}
|
||||
|
||||
logout(){
|
||||
this.tokenService.logout();
|
||||
this.router.navigate(['/login-page'], { queryParams: { /*returnUrl: this.state.url*/ }});
|
||||
this.router.navigate(['/login'], { queryParams: { /*returnUrl: this.state.url*/ }});
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -18,7 +18,6 @@ import { TokenService, TokenProvider } from './services/login/token.service';
|
|||
import { LocalStorageService } from 'ngx-webstorage';
|
||||
import { dataModelBuilder } from './services/dataModelBuilder.service';
|
||||
import { DynamicFormGroupComponent } from './form/dynamic-form-group/dynamic-form-group.component';
|
||||
//import { LoginComponent } from './login/login-page';
|
||||
import { AppRoutingModule } from './app-routing.module';
|
||||
import { AuthGuard } from './guards/auth.guard';
|
||||
import { PageNotFoundComponent } from './not-found.component';
|
||||
|
|
|
@ -13,7 +13,7 @@ export class AuthGuard implements CanActivate {
|
|||
return true;
|
||||
}
|
||||
// not logged in so redirect to login page with the return url
|
||||
this.router.navigate(['/login-page'], { queryParams: { returnUrl: state.url }});
|
||||
this.router.navigate(['/login'], { queryParams: { returnUrl: state.url }});
|
||||
return false;
|
||||
|
||||
}
|
||||
|
|
|
@ -21,7 +21,7 @@ export class GlobalInterceptor implements HttpInterceptor {
|
|||
if (err instanceof HttpErrorResponse) {
|
||||
if (err.status === 401) {
|
||||
this.tokenService.logout();
|
||||
this.router.navigate(['/dmps'], { queryParams: { /*returnUrl: this.state.url*/ }});
|
||||
this.router.navigate(['/login'], { queryParams: { /*returnUrl: this.state.url*/ }});
|
||||
}
|
||||
}
|
||||
});
|
||||
|
|
|
@ -6,7 +6,6 @@ import {dataModelBuilder} from '../../app/services/dataModelBuilder.service';
|
|||
import { DatasetProfile } from '../entities/datasetprofile';
|
||||
import {DataModel} from '../entities/DataModel';
|
||||
import {Project} from '../entities/model/project';
|
||||
//import {LoginComponent} from '../../app/login/login-page';
|
||||
import { TokenService, TokenProvider } from './login/token.service';
|
||||
import {RestBase} from './rest-base';
|
||||
import 'rxjs/Rx';
|
||||
|
|
Loading…
Reference in New Issue