mirror of
https://github.com/umami-software/umami.git
synced 2026-02-07 22:27:16 +01:00
Refactor auth logic.
This commit is contained in:
parent
edd1751b81
commit
5e2d23f18f
10 changed files with 40 additions and 30 deletions
|
|
@ -9,10 +9,10 @@ export default async (req, res) => {
|
|||
const website = await getWebsiteByShareId(id);
|
||||
|
||||
if (website) {
|
||||
const websiteId = website.websiteId;
|
||||
const token = createToken({ websiteId: websiteId }, secret());
|
||||
const { websiteId, websiteUuid } = website;
|
||||
const token = createToken({ websiteId, websiteUuid }, secret());
|
||||
|
||||
return ok(res, { websiteId, token });
|
||||
return ok(res, { websiteId, websiteUuid, token });
|
||||
}
|
||||
|
||||
return notFound(res);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue