mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-03-06 13:40:25 +00:00
Add hook to expose uid (#5612)
* add hook to expose uid * use whenever for cleaner code
This commit is contained in:
@@ -7,3 +7,7 @@ export type ApiKeyAuthHeader = {
|
||||
}
|
||||
|
||||
export type AuthHeader = LoggedInAuthHeader | ApiKeyAuthHeader
|
||||
|
||||
export interface AuthUserInfo {
|
||||
id: string
|
||||
}
|
||||
|
||||
@@ -7,6 +7,7 @@ import type { ComfyNodeDef } from '@/schemas/nodeDefSchema'
|
||||
import type { ComfyApp } from '@/scripts/app'
|
||||
import type { ComfyWidgetConstructor } from '@/scripts/widgets'
|
||||
import type { ComfyCommand } from '@/stores/commandStore'
|
||||
import type { AuthUserInfo } from '@/types/authTypes'
|
||||
import type { BottomPanelExtension } from '@/types/extensionTypes'
|
||||
|
||||
type Widgets = Record<string, ComfyWidgetConstructor>
|
||||
@@ -166,5 +167,12 @@ export interface ComfyExtension {
|
||||
missingNodeTypes: MissingNodeType[]
|
||||
): Promise<void> | void
|
||||
|
||||
/**
|
||||
* Fired whenever authentication resolves, providing the anonymized user id..
|
||||
* Extensions can register at any time and will receive the latest value immediately.
|
||||
* This is an experimental API and may be changed or removed in the future.
|
||||
*/
|
||||
onAuthUserResolved?(user: AuthUserInfo, app: ComfyApp): Promise<void> | void
|
||||
|
||||
[key: string]: any
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user