Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🛂 remove restricted access #28

Merged
merged 9 commits into from
Jun 21, 2024
Merged
16 changes: 3 additions & 13 deletions src/app/app-routing.module.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
import { Component, NgModule } from '@angular/core';
import { NgModule } from '@angular/core';
import { RouterModule, Routes } from '@angular/router';

import { AuthGuard } from './auth/auth.guard';
import { HomeComponent } from './home/home.component';
import { AboutComponent } from './about/about.component';
import { LoginComponent } from './auth/login/login.component';
import { DatasetsComponent } from './datasets/datasets.component';
import { DatasetDetailComponent } from './datasets/dataset-detail/dataset-detail.component';
import { DatasetResolver } from './datasets/dataset-detail/dataset-resolver.service';
Expand All @@ -21,43 +19,35 @@ import { VariantResolver } from './variants/variant-detail/variant-resolver.serv
const routes: Routes = [
{ path: '', component: HomeComponent },
{ path: 'about', component: AboutComponent },
{ path: 'login', component: LoginComponent },
{
path: 'breeds',
component: BreedsComponent,
canActivate: [ AuthGuard ]
component: BreedsComponent
},
{
path: 'datasets',
component: DatasetsComponent,
canActivate: [ AuthGuard ]
component: DatasetsComponent
},
{
path: 'datasets/:_id',
component: DatasetDetailComponent,
canActivate: [ AuthGuard ],
resolve: { dataset: DatasetResolver }
},
{
path: 'samples',
component: SamplesComponent,
canActivate: [ AuthGuard ]
},
{
path: 'samples/:species/:_id',
component: SampleDetailComponent,
canActivate: [ AuthGuard ],
resolve: { sample: SampleResolver }
},
{
path: 'variants',
component: VariantsComponent,
canActivate: [ AuthGuard ],
},
{
path: 'variants/:species/:_id',
component: VariantDetailComponent,
canActivate: [ AuthGuard ],
resolve: { variant: VariantResolver }
},
{
Expand Down
12 changes: 2 additions & 10 deletions src/app/app.component.ts
Original file line number Diff line number Diff line change
@@ -1,19 +1,11 @@
import { Component, OnInit } from '@angular/core';

import { AuthService } from './auth/auth.service';
import { Component } from '@angular/core';

@Component({
selector: 'app-root',
templateUrl: './app.component.html',
styleUrls: ['./app.component.scss']
})
export class AppComponent implements OnInit {
export class AppComponent {
title = 'SMARTER-frontend';

constructor(private authService: AuthService) { }

ngOnInit(): void {
// try authologin when starting application
this.authService.autoLogin();
}
}
10 changes: 1 addition & 9 deletions src/app/app.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,9 @@ import { AppRoutingModule } from './app-routing.module';
import { AppComponent } from './app.component';
import { MaterialModule } from './material/material.module';
import { HomeComponent } from './home/home.component';
import { LoginComponent } from './auth/login/login.component';
import { HeaderComponent } from './navigation/header/header.component';
import { SidenavListComponent } from './navigation/sidenav-list/sidenav-list.component';
import { DatasetsComponent } from './datasets/datasets.component';
import { AuthInterceptorService } from './auth/auth-interceptor.service';
import { NotFoundComponent } from './not-found/not-found.component';
import { ShortenPipe } from './shared/shorten.pipe';
import { BreedsComponent } from './breeds/breeds.component';
Expand All @@ -33,7 +31,6 @@ import { AboutComponent } from './about/about.component';
declarations: [
AppComponent,
HomeComponent,
LoginComponent,
HeaderComponent,
SidenavListComponent,
DatasetsComponent,
Expand Down Expand Up @@ -62,12 +59,7 @@ import { AboutComponent } from './about/about.component';
MaterialModule
],
providers: [
{
provide: HTTP_INTERCEPTORS,
useClass: AuthInterceptorService,
// required, even if it is the only interceptor defined
multi: true
}

],
bootstrap: [AppComponent]
})
Expand Down
5 changes: 0 additions & 5 deletions src/app/auth/auth-data.model.ts

This file was deleted.

28 changes: 0 additions & 28 deletions src/app/auth/auth-interceptor.service.spec.ts

This file was deleted.

39 changes: 0 additions & 39 deletions src/app/auth/auth-interceptor.service.ts

This file was deleted.

45 changes: 0 additions & 45 deletions src/app/auth/auth.guard.ts

This file was deleted.

74 changes: 0 additions & 74 deletions src/app/auth/auth.service.spec.ts

This file was deleted.

Loading
Loading