mirror of
https://github.com/umami-software/umami.git
synced 2026-02-09 23:27:12 +01:00
Add grant to create website/team.
This commit is contained in:
parent
84236c0cd9
commit
280f6a9113
3 changed files with 31 additions and 5 deletions
|
|
@ -51,7 +51,7 @@ export const useAuth = createMiddleware(async (req, res, next) => {
|
|||
const shareToken = await parseShareToken(req);
|
||||
|
||||
let user = null;
|
||||
const { userId, authKey } = payload || {};
|
||||
const { userId, authKey, grant } = payload || {};
|
||||
|
||||
if (isUuid(userId)) {
|
||||
user = await getUserById(userId);
|
||||
|
|
@ -72,7 +72,13 @@ export const useAuth = createMiddleware(async (req, res, next) => {
|
|||
user.isAdmin = user.role === ROLES.admin;
|
||||
}
|
||||
|
||||
(req as any).auth = { user, token, shareToken, authKey };
|
||||
(req as any).auth = {
|
||||
user,
|
||||
grant,
|
||||
token,
|
||||
shareToken,
|
||||
authKey,
|
||||
};
|
||||
|
||||
next();
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue