mirror of
https://github.com/umami-software/umami.git
synced 2026-02-07 14:17:13 +01:00
Merge branch 'dev' into jajaja
This commit is contained in:
commit
5c988ab5ff
10 changed files with 398 additions and 404 deletions
|
|
@ -87,7 +87,7 @@ export async function POST(request: Request) {
|
|||
return forbidden();
|
||||
}
|
||||
|
||||
const sessionId = uuid(websiteId, hostname, ip, userAgent);
|
||||
const sessionId = uuid(websiteId, ip, userAgent);
|
||||
|
||||
// Find session
|
||||
if (!clickhouse.enabled && !cache?.sessionId) {
|
||||
|
|
|
|||
|
|
@ -10,7 +10,6 @@ export async function POST(request: Request) {
|
|||
const schema = z.object({
|
||||
username: z.string().max(255),
|
||||
password: z.string(),
|
||||
id: z.string().uuid(),
|
||||
role: z.string().regex(/admin|user|view-only/i),
|
||||
});
|
||||
|
||||
|
|
@ -24,7 +23,7 @@ export async function POST(request: Request) {
|
|||
return unauthorized();
|
||||
}
|
||||
|
||||
const { username, password, role, id } = body;
|
||||
const { username, password, role } = body;
|
||||
|
||||
const existingUser = await getUserByUsername(username, { showDeleted: true });
|
||||
|
||||
|
|
@ -33,7 +32,7 @@ export async function POST(request: Request) {
|
|||
}
|
||||
|
||||
const user = await createUser({
|
||||
id: id || uuid(),
|
||||
id: uuid(),
|
||||
username,
|
||||
password: hashPassword(password),
|
||||
role: role ?? ROLES.user,
|
||||
|
|
|
|||
|
|
@ -125,7 +125,7 @@ function getChannels(data: { domain: string; query: string; visitors: number }[]
|
|||
|
||||
const match = (value: string) => {
|
||||
return (str: string | RegExp) => {
|
||||
return typeof str === 'string' ? value.includes(str) : (str as RegExp).test(value);
|
||||
return typeof str === 'string' ? value?.includes(str) : (str as RegExp).test(value);
|
||||
};
|
||||
};
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue