Add a persistent clip library with folders, optional password, and hidden-thumbnail glow.
Generated videos save into a chosen folder, sensitive clips skip thumbnails until played, and Docker writes the catalog to a Coolify volume. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -9,6 +9,7 @@ export interface SessionUser {
|
||||
|
||||
const COOKIE = 'aigen_session'
|
||||
const STATE_COOKIE = 'aigen_oauth_state'
|
||||
const LIBRARY_COOKIE = 'aigen_library'
|
||||
|
||||
function secret() {
|
||||
const config = useRuntimeConfig()
|
||||
@@ -78,6 +79,18 @@ export function authEnabled() {
|
||||
return Boolean(config.public.authEnabled && config.oidcClientId && config.oidcClientSecret)
|
||||
}
|
||||
|
||||
export function setLibraryUnlock(event: H3Event, version: string) {
|
||||
setCookie(event, LIBRARY_COOKIE, seal({ version }), cookieOpts(event))
|
||||
}
|
||||
|
||||
export function getLibraryUnlockVersion(event: H3Event) {
|
||||
return unseal<{ version?: string }>(getCookie(event, LIBRARY_COOKIE))?.version || null
|
||||
}
|
||||
|
||||
export function clearLibraryUnlock(event: H3Event) {
|
||||
deleteCookie(event, LIBRARY_COOKIE, { path: '/' })
|
||||
}
|
||||
|
||||
export function publicBaseUrl(event: H3Event) {
|
||||
const proto = getRequestHeader(event, 'x-forwarded-proto') || getRequestProtocol(event)
|
||||
const host = getRequestHeader(event, 'x-forwarded-host') || getRequestHost(event)
|
||||
|
||||
Reference in New Issue
Block a user