Files
windmill/frontend/src/lib/userExt.ts
T
Diego ImbertandRuben Fiszel c09764fa65 perf: load public raw apps without the loading screen (#11608)
* perf: load public raw apps without the loading screen

* fix: keep license store and drop stale prefetches on public app pages

* fix: answer raw app requests with an error when the job bridge fails to load

---------

Co-authored-by: Ruben Fiszel <ruben@windmill.dev>
2026-10-08 09:15:01 +02:00

16 lines
489 B
TypeScript

import type { User } from '$lib/gen/types.gen'
import type { UserExt } from './stores'
export function mapUserToUserExt(user: User, workspace: string): UserExt {
const ext: UserExt = {
...user,
workspace_id: workspace,
groups: user.groups!,
pgroups: user.groups!.map((x) => `g/${x}`)
}
if (ext.is_service_account && sessionStorage.getItem('pre_impersonation_token')) {
ext.impersonating_email = sessionStorage.getItem('pre_impersonation_email') ?? undefined
}
return ext
}