move the angular federated sign-in library from the login module to the app module for use in the new account module
parent
c902cc34d2
commit
5431d7a1a7
|
@ -3,6 +3,13 @@ import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
|
|||
import { FlexLayoutModule } from '@angular/flex-layout';
|
||||
import { NgModule } from '@angular/core';
|
||||
|
||||
import {
|
||||
AuthServiceConfig,
|
||||
FacebookLoginProvider,
|
||||
GoogleLoginProvider,
|
||||
SocialLoginModule
|
||||
} from 'angular-6-social-login';
|
||||
|
||||
import { AppComponent } from './app.component';
|
||||
import { AppRoutingModule } from './app-routing.module';
|
||||
import { ChangePasswordModule } from './modules/change-password/change-password.module';
|
||||
|
@ -11,6 +18,25 @@ import { LoginModule } from './modules/login/login.module';
|
|||
import { LogoutModule } from './modules/logout/logout.module';
|
||||
import { SharedModule as SharedLibModule } from 'shared';
|
||||
import { SharedModule } from './shared/shared.module';
|
||||
import { environment } from '../environments/environment';
|
||||
import { ApiService } from './core/http/api.service';
|
||||
|
||||
|
||||
export function getAuthServiceConfigs() {
|
||||
return new AuthServiceConfig(
|
||||
[
|
||||
{
|
||||
id: FacebookLoginProvider.PROVIDER_ID,
|
||||
provider: new FacebookLoginProvider(environment.facebookClientId)
|
||||
},
|
||||
{
|
||||
id: GoogleLoginProvider.PROVIDER_ID,
|
||||
provider: new GoogleLoginProvider(environment.googleClientId)
|
||||
}
|
||||
]
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@NgModule({
|
||||
declarations: [
|
||||
|
@ -26,9 +52,13 @@ import { SharedModule } from './shared/shared.module';
|
|||
SharedModule,
|
||||
LoginModule,
|
||||
LogoutModule,
|
||||
SocialLoginModule,
|
||||
AppRoutingModule
|
||||
],
|
||||
providers: [ ],
|
||||
providers: [
|
||||
ApiService,
|
||||
{ provide: AuthServiceConfig, useFactory: getAuthServiceConfigs }
|
||||
],
|
||||
bootstrap: [ AppComponent ]
|
||||
})
|
||||
export class AppModule { }
|
||||
|
|
|
@ -13,12 +13,6 @@ import {
|
|||
} from '@angular/material';
|
||||
import { RouterModule } from '@angular/router';
|
||||
|
||||
import {
|
||||
AuthServiceConfig,
|
||||
FacebookLoginProvider,
|
||||
GoogleLoginProvider,
|
||||
SocialLoginModule
|
||||
} from 'angular-6-social-login';
|
||||
import { FontAwesomeModule } from '@fortawesome/angular-fontawesome';
|
||||
|
||||
import { ApiService } from '../../core/http/api.service';
|
||||
|
@ -30,21 +24,6 @@ import { PasswordResetComponent } from './password-reset/password-reset.componen
|
|||
import { SharedModule } from '../../shared/shared.module';
|
||||
|
||||
|
||||
export function getAuthServiceConfigs() {
|
||||
return new AuthServiceConfig(
|
||||
[
|
||||
{
|
||||
id: FacebookLoginProvider.PROVIDER_ID,
|
||||
provider: new FacebookLoginProvider(environment.facebookClientId)
|
||||
},
|
||||
{
|
||||
id: GoogleLoginProvider.PROVIDER_ID,
|
||||
provider: new GoogleLoginProvider(environment.googleClientId)
|
||||
}
|
||||
]
|
||||
);
|
||||
}
|
||||
|
||||
@NgModule({
|
||||
declarations: [
|
||||
LoginComponent,
|
||||
|
@ -74,12 +53,7 @@ export function getAuthServiceConfigs() {
|
|||
MatSnackBarModule,
|
||||
ReactiveFormsModule,
|
||||
SharedModule,
|
||||
SocialLoginModule,
|
||||
RouterModule
|
||||
],
|
||||
providers: [
|
||||
ApiService,
|
||||
{ provide: AuthServiceConfig, useFactory: getAuthServiceConfigs }
|
||||
]
|
||||
})
|
||||
export class LoginModule { }
|
||||
|
|
|
@ -23,7 +23,7 @@ export class GoogleButtonComponent {
|
|||
(userData) => {
|
||||
this.googleToken.emit({platform: 'Google', token: userData.idToken});
|
||||
}
|
||||
);
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue