@furystack/auth-google
Version:
Google Authentication Provider for FuryStack
41 lines • 1.28 kB
TypeScript
import type { User } from '@furystack/core';
import { get } from 'https';
/**
* Payload model from Google
*/
export interface GoogleApiPayload {
iss: string;
sub: number;
email: string;
email_verified: boolean;
name: string;
picture: string;
given_name: string;
family_name: string;
locale: string;
}
export declare class GoogleLoginSettings {
get: typeof get;
private readonly userStore;
getUserFromGooglePayload: (payload: GoogleApiPayload) => Promise<User | undefined>;
}
/**
* Service class for Google OAuth authentication
*/
export declare class GoogleLoginService {
private readonly settings;
private readonly googleApiEndpoint;
readPostBody: <T>(incomingMessage: import("http").IncomingMessage) => Promise<T>;
/**
* @param token The ID Token
* @returns the extracted Google Authentication data from the token.
*/
getGoogleUserData(token: string): Promise<GoogleApiPayload>;
/**
* Authenticates the user with an IdToken and returns a user. The user will be inserted to the DataStore if not present.
* @param token The IdToken to authenticate
* @returns The current user
*/
login(token: string): Promise<User>;
}
//# sourceMappingURL=login-service.d.ts.map