mirror of
https://github.com/umami-software/umami.git
synced 2026-02-10 07:37:11 +01:00
Removed grant checks.
This commit is contained in:
parent
48c7028a3a
commit
5c9f97182e
4 changed files with 9 additions and 32 deletions
|
|
@ -21,7 +21,7 @@ export async function checkAuth(request: Request) {
|
|||
const shareToken = await parseShareToken(request);
|
||||
|
||||
let user = null;
|
||||
const { userId, authKey, grant } = payload || {};
|
||||
const { userId, authKey } = payload || {};
|
||||
|
||||
if (userId) {
|
||||
user = await getUser(userId);
|
||||
|
|
@ -33,7 +33,7 @@ export async function checkAuth(request: Request) {
|
|||
}
|
||||
}
|
||||
|
||||
log({ token, shareToken, payload, user, grant });
|
||||
log({ token, payload, authKey, shareToken, user });
|
||||
|
||||
if (!user?.id && !shareToken) {
|
||||
log('User not authorized');
|
||||
|
|
@ -45,11 +45,10 @@ export async function checkAuth(request: Request) {
|
|||
}
|
||||
|
||||
return {
|
||||
user,
|
||||
grant,
|
||||
token,
|
||||
shareToken,
|
||||
authKey,
|
||||
shareToken,
|
||||
user,
|
||||
};
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
import { UseQueryOptions } from '@tanstack/react-query';
|
||||
import { DATA_TYPE, PERMISSIONS, ROLES, OPERATORS } from './constants';
|
||||
import { DATA_TYPE, ROLES, OPERATORS } from './constants';
|
||||
import { TIME_UNIT } from './date';
|
||||
|
||||
export type ObjectValues<T> = T[keyof T];
|
||||
|
|
@ -7,7 +7,6 @@ export type ObjectValues<T> = T[keyof T];
|
|||
export type ReactQueryOptions<T = any> = Omit<UseQueryOptions<T, Error, T>, 'queryKey' | 'queryFn'>;
|
||||
|
||||
export type TimeUnit = ObjectValues<typeof TIME_UNIT>;
|
||||
export type Permission = ObjectValues<typeof PERMISSIONS>;
|
||||
export type Role = ObjectValues<typeof ROLES>;
|
||||
export type DynamicDataType = ObjectValues<typeof DATA_TYPE>;
|
||||
export type Operator = (typeof OPERATORS)[keyof typeof OPERATORS];
|
||||
|
|
@ -19,7 +18,6 @@ export interface Auth {
|
|||
role: string;
|
||||
isAdmin: boolean;
|
||||
};
|
||||
grant?: Permission[];
|
||||
shareToken?: {
|
||||
websiteId: string;
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue