Skip to content
This repository was archived by the owner on Sep 21, 2023. It is now read-only.
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 9 additions & 4 deletions index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -71,10 +71,15 @@ export interface GoogleLoginResponseOffline {
readonly code: string;
}

export interface GoogleAuthError {
error: string;
description?: string;
}

export interface GoogleLoginProps {
readonly onSuccess?: (response: GoogleLoginResponse | GoogleLoginResponseOffline) => void,
readonly onAutoLoadFinished?: (successLogin: boolean) => void,
readonly onFailure?: (error: any) => void,
readonly onFailure?: (authError: GoogleAuthError) => void,
readonly onScriptLoadFailure?: (error: any) => void,
readonly onRequest?: () => void,
readonly clientId: string,
Expand Down Expand Up @@ -111,7 +116,7 @@ export class GoogleLogin extends Component<GoogleLoginProps, unknown> {
export interface GoogleLogoutProps {
readonly clientId: string,
readonly onLogoutSuccess?: () => void;
readonly onFailure?: () => void;
readonly onFailure?: (authError: GoogleAuthError) => void;
readonly buttonText?: string;
readonly className?: string;
readonly children?: ReactNode;
Expand All @@ -136,7 +141,7 @@ export interface UseGoogleLogoutResponse {
export interface UseGoogleLogoutProps {
readonly clientId: string,
readonly onLogoutSuccess?: () => void;
readonly onFailure?: () => void;
readonly onFailure?: (authError: GoogleAuthError) => void;
readonly accessType?: string;
readonly fetchBasicProfile?: boolean;
readonly cookiePolicy?: string;
Expand All @@ -158,7 +163,7 @@ export interface UseGoogleLoginResponse {

export interface UseGoogleLoginProps {
readonly onSuccess?: (response: GoogleLoginResponse | GoogleLoginResponseOffline) => void,
readonly onFailure?: (error: any) => void,
readonly onFailure?: (authError: GoogleAuthError) => void,
readonly onScriptLoadFailure?: (error: any) => void,
readonly onAutoLoadFinished?: (successLogin: boolean) => void,
readonly clientId: string,
Expand Down