port user ID expose hook from 6786d8e to cloud

This commit is contained in:
bymyself
2025-09-16 15:13:32 -07:00
parent e035f895a3
commit 775c856bf7
4 changed files with 45 additions and 1 deletions

View File

@@ -7,3 +7,7 @@ export type ApiKeyAuthHeader = {
}
export type AuthHeader = LoggedInAuthHeader | ApiKeyAuthHeader
export interface AuthUserInfo {
id: string
}

View File

@@ -6,6 +6,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'
import type { SettingParams } from '@/types/settingTypes'
@@ -166,5 +167,11 @@ export interface ComfyExtension {
missingNodeTypes: MissingNodeType[]
): Promise<void> | void
/**
* Fired whenever authentication resolves, providing the user id.
* Extensions can register at any time and will receive the latest value immediately.
*/
onAuthUserResolved?(user: AuthUserInfo, app: ComfyApp): Promise<void> | void
[key: string]: any
}