mirror of
https://github.com/louislam/uptime-kuma.git
synced 2026-08-07 11:24:59 +00:00
add authInternal shortcut function (Big thanks @Ionys320)
This commit is contained in:
+12
-1
@@ -21,7 +21,9 @@ let godKumaHeaders: Headers;
|
||||
let godKumaInitSecret: string = "";
|
||||
|
||||
/**
|
||||
*
|
||||
* Get the singleton instance of better-auth
|
||||
* Mainly used for http and socket.io authentication
|
||||
* @returns The singleton instance of better-auth
|
||||
*/
|
||||
export function auth() {
|
||||
if (authInstance) {
|
||||
@@ -31,6 +33,15 @@ export function auth() {
|
||||
return authInstance;
|
||||
}
|
||||
|
||||
/**
|
||||
* Do staff without any auth
|
||||
* For internal usage only, the api should be a superset of auth().api
|
||||
* @returns Internal adapter of better-auth
|
||||
*/
|
||||
export async function authInternal() {
|
||||
return (await auth().$context).internalAdapter;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user