mirror of
https://gitlab.com/openstapps/openstapps.git
synced 2026-01-20 00:23:03 +00:00
feat: add auth support (default and paia)
This commit is contained in:
committed by
Jovan Krunić
parent
046a95ba1d
commit
b5f239ea4e
47
src/app/modules/auth/auth.module.ts
Normal file
47
src/app/modules/auth/auth.module.ts
Normal file
@@ -0,0 +1,47 @@
|
||||
import {NgModule} from '@angular/core';
|
||||
import {CommonModule} from '@angular/common';
|
||||
import {Platform} from '@ionic/angular';
|
||||
import {Requestor, StorageBackend} from '@openid/appauth';
|
||||
import {authFactory, paiaAuthFactory, storageFactory} from './factories';
|
||||
import {DefaultAuthService} from './default-auth.service';
|
||||
import {Browser} from 'ionic-appauth';
|
||||
import {CapacitorBrowser} from 'ionic-appauth/lib/capacitor';
|
||||
import {httpFactory} from './factories/http.factory';
|
||||
import {HttpClient} from '@angular/common/http';
|
||||
import {PAIAAuthService} from './paia/paia-auth.service';
|
||||
import {AuthRoutingModule} from './auth-routing.module';
|
||||
import {TranslateModule} from '@ngx-translate/core';
|
||||
import {AuthCallbackPageComponent} from './auth-callback/page/auth-callback-page.component';
|
||||
import {PAIAAuthCallbackPageComponent} from './paia/auth-callback/page/auth-callback-page.component';
|
||||
|
||||
@NgModule({
|
||||
declarations: [AuthCallbackPageComponent, PAIAAuthCallbackPageComponent],
|
||||
imports: [CommonModule, AuthRoutingModule, TranslateModule],
|
||||
providers: [
|
||||
{
|
||||
provide: StorageBackend,
|
||||
useFactory: storageFactory,
|
||||
deps: [Platform],
|
||||
},
|
||||
{
|
||||
provide: Requestor,
|
||||
useFactory: httpFactory,
|
||||
deps: [Platform, HttpClient],
|
||||
},
|
||||
{
|
||||
provide: Browser,
|
||||
useClass: CapacitorBrowser,
|
||||
},
|
||||
{
|
||||
provide: DefaultAuthService,
|
||||
useFactory: authFactory,
|
||||
deps: [Requestor, Browser, StorageBackend],
|
||||
},
|
||||
{
|
||||
provide: PAIAAuthService,
|
||||
useFactory: paiaAuthFactory,
|
||||
deps: [Requestor, Browser, StorageBackend],
|
||||
},
|
||||
],
|
||||
})
|
||||
export class AuthModule {}
|
||||
Reference in New Issue
Block a user