mirror of
https://github.com/umami-software/umami.git
synced 2026-02-04 04:37:11 +01:00
Refactor API authentication.
This commit is contained in:
parent
c33729e185
commit
5a4fc96ebc
13 changed files with 71 additions and 73 deletions
|
|
@ -30,7 +30,7 @@ export default async (req, res) => {
|
|||
}
|
||||
|
||||
if (req.method === 'POST') {
|
||||
const { name, domain, owner, enable_share_url } = req.body;
|
||||
const { name, domain, owner, enableShareUrl } = req.body;
|
||||
|
||||
const website_owner = account ? account.id : +owner;
|
||||
|
||||
|
|
@ -39,7 +39,7 @@ export default async (req, res) => {
|
|||
}
|
||||
|
||||
const websiteUuid = uuid();
|
||||
const shareId = enable_share_url ? getRandomChars(8) : null;
|
||||
const shareId = enableShareUrl ? getRandomChars(8) : null;
|
||||
const website = await createWebsite(website_owner, { websiteUuid, name, domain, shareId });
|
||||
|
||||
return ok(res, website);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue