1- import { Injectable } from '@angular/core' ;
2- import { LocationStrategy , PlatformLocation } from "@angular/common" ;
1+ import { Inject , Injectable } from '@angular/core' ;
2+ import { LocationStrategy } from "@angular/common" ;
3+ import { Config , FUSIO_CONFIG , Provider } from "../config/config" ;
34
45@Injectable ( {
56 providedIn : 'root'
@@ -8,7 +9,7 @@ export class ProviderService {
89
910 providers : Array < Provider > = [ ] ;
1011
11- constructor ( private location : LocationStrategy , private config : ProviderServiceConfig ) {
12+ constructor ( private location : LocationStrategy , @ Inject ( FUSIO_CONFIG ) private config : Config ) {
1213 this . providers = this . getProviders ( ) ;
1314 }
1415
@@ -66,7 +67,7 @@ export class ProviderService {
6667 }
6768
6869 public getProviders ( ) : Array < Provider > {
69- return this . config . getProviders ( ) ;
70+ return this . config . providers || [ ] ;
7071 }
7172
7273 private getProviderByName ( name : string ) : Provider | undefined {
@@ -91,25 +92,7 @@ export class ProviderService {
9192
9293}
9394
94- export interface Provider {
95- name : string ,
96- icon : string ,
97- key : string
98- url : string ,
99- params : Record < string , string >
100- }
101-
10295export interface Verification {
10396 clientId : string ,
10497 redirectUri : string ,
10598}
106-
107- enum ProviderType {
108- github ,
109- google ,
110- facebook ,
111- }
112-
113- export interface ProviderServiceConfig {
114- getProviders ( ) : Array < Provider > ;
115- }
0 commit comments