fix document 500 error and fix users tabel for bot
This commit is contained in:
@@ -13,6 +13,11 @@ interface RequesterProfile {
|
||||
async function getRequesterProfile(jwt: JwtService, core: CoreGrpcService, authorization?: string): Promise<RequesterProfile> {
|
||||
const payload = await verifyAccessToken(jwt, authorization);
|
||||
await assertSessionUnlocked(core, payload);
|
||||
|
||||
if (payload.isSuperAdmin) {
|
||||
return { id: payload.sub, isSuperAdmin: true, canViewUserDocuments: true };
|
||||
}
|
||||
|
||||
const profile = (await firstValueFrom(core.auth.GetMe({ userId: payload.sub }))) as RequesterProfile & { id: string };
|
||||
return { id: profile.id, isSuperAdmin: profile.isSuperAdmin, canViewUserDocuments: profile.canViewUserDocuments };
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user