Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
import { BrowserModule } from '@angular/platform-browser';
import { NgModule } from '@angular/core';
import { FormsModule } from '@angular/forms';
import { HttpModule } from '@angular/http';
import { AppComponent } from './app.component';
import { NavbarComponent } from './navbar/navbar.component';
import { DemoComponent } from './demo/demo.component';
import { SocialLoginModule } from 'angularx-social-login';
import { AuthServiceConfig, GoogleLoginProvider, FacebookLoginProvider, LinkedInLoginProvider } from 'angularx-social-login';
const config = new AuthServiceConfig([
{
id: GoogleLoginProvider.PROVIDER_ID,
provider: new GoogleLoginProvider('624796833023-clhjgupm0pu6vgga7k5i5bsfp6qp6egh.apps.googleusercontent.com')
},
{
id: FacebookLoginProvider.PROVIDER_ID,
provider: new FacebookLoginProvider('561602290896109')
},
{
id: LinkedInLoginProvider.PROVIDER_ID,
provider: new LinkedInLoginProvider('78iqy5cu2e1fgr')
}
]);
export function provideConfig() {
return config;
import { BrowserModule } from '@angular/platform-browser';
import { NgModule } from '@angular/core';
import { SocialLoginModule, AuthServiceConfig, GoogleLoginProvider } from 'angularx-social-login';
import { AppComponent } from './app.component';
const config = new AuthServiceConfig([]);
@NgModule({
declarations: [
AppComponent
],
imports: [
BrowserModule,
SocialLoginModule,
],
providers: [{
provide: AuthServiceConfig, useFactory: () => config,
}],
bootstrap: [AppComponent]
})
export class AppModule {
constructor() {}
export function getAuthServiceConfigs(configService: ConfigService) {
const autServiceConfig: AuthServiceConfig = new AuthServiceConfig([]);
const googleLoginOptions: LoginOpt = {
prompt: 'select_account'
};
configService.getConfig().subscribe((config) => {
if (config != null) {
if (configService.getGoogleClientId() != null) {
autServiceConfig.providers.set(GoogleLoginProvider.PROVIDER_ID,
new GoogleLoginProvider(configService.getGoogleClientId(), googleLoginOptions));
}
}
});
return autServiceConfig;
}