This commit is contained in:
Benjamin Toby
2025-04-18 12:06:15 +01:00
parent 8d38f99bf1
commit 6593047efd
180 changed files with 3965 additions and 2 deletions
+13
View File
@@ -0,0 +1,13 @@
type Param = {
clientId: string;
redirectUrl: string;
setLoading?: (arg0: boolean) => void;
scopes?: string[];
};
/**
* Login with Github Function
* ===============================================================================
* @description This function uses github api to login a user with datasquirel
*/
export default function getAccessToken({ clientId, redirectUrl, setLoading, scopes, }: Param): void;
export {};
+18
View File
@@ -0,0 +1,18 @@
interface GoogleGetAccessTokenFunctionParams {
clientId: string;
triggerPrompt?: boolean;
setLoading?: React.Dispatch<React.SetStateAction<boolean>>;
}
/**
* Login with Google Function
* ===============================================================================
* @description This function uses google identity api to login a user with datasquirel
*/
export default function getAccessToken(params: GoogleGetAccessTokenFunctionParams): Promise<string>;
/**
* # Google Login Function
*/
export declare function googleLogin({ google, clientId, setLoading, triggerPrompt, }: GoogleGetAccessTokenFunctionParams & {
google: any;
}): Promise<unknown>;
export {};
+8
View File
@@ -0,0 +1,8 @@
/**
* Login with Google Function
* ===============================================================================
* @description This function uses google identity api to login a user with datasquirel
*/
export default function logout(params?: {
googleClientId?: any;
}): Promise<boolean>;
+9
View File
@@ -0,0 +1,9 @@
import { APILoginFunctionReturn } from "../../package-shared/types";
/**
* Client Setup After Login
* ===============================================================================
* @description This function sets local storage variables like `csrf` after a user
* is logged in. Use this in conjunction with the `datasquirel.user.loginUser`
* function
*/
export default function postLogin(res: APILoginFunctionReturn): boolean;