### File

`projects/commons/src/lib/elements/social-login/services/social-login.service.ts`

### Index

###### Methods
Public authState Public signOut Public singInWithFacebook Public singInWithGoogle

### Constructor

`constructor(socialAuthService: SocialAuthService)`
Defined in projects/commons/src/lib/elements/social-login/services/social-login.service.ts:12
Parameters :
Name | Type | Optional
socialAuthService | `SocialAuthService` | No

### Methods

Public authState
`authState()`
Defined in projects/commons/src/lib/elements/social-login/services/social-login.service.ts:15
Returns : `Observable<SocialUser>`

Public signOut
`signOut()`
Defined in projects/commons/src/lib/elements/social-login/services/social-login.service.ts:27
Returns : `void`

Public singInWithFacebook
`singInWithFacebook()`
Defined in projects/commons/src/lib/elements/social-login/services/social-login.service.ts:23
Returns : `void`

Public singInWithGoogle
`singInWithGoogle()`
Defined in projects/commons/src/lib/elements/social-login/services/social-login.service.ts:19
Returns : `void`

    import { Observable } from 'rxjs';
    import { Injectable } from '@angular/core';

    import {
        AuthService as SocialAuthService,
        FacebookLoginProvider,
        GoogleLoginProvider,
        SocialUser
    } from 'angularx-social-login';

    @Injectable()
    export class SocialLoginService {
        constructor(private readonly socialAuthService: SocialAuthService) {}

        public authState(): Observable<SocialUser> {
            return this.socialAuthService.authState;
        }

        public singInWithGoogle(): void {
            this.socialAuthService.signIn(GoogleLoginProvider.PROVIDER_ID);
        }

        public singInWithFacebook(): void {
            this.socialAuthService.signIn(FacebookLoginProvider.PROVIDER_ID);
        }

        public signOut(): void {
            this.socialAuthService.signOut();
        }
    }

# result-matching ""

# No results matching ""