Skip to content

Commit b5017b8

Browse files
committed
Merge branch 'next' of github.com:devforth/adminforth into next
2 parents a1638a2 + 1f437b3 commit b5017b8

File tree

2 files changed

+10
-3
lines changed

2 files changed

+10
-3
lines changed

adminforth/auth.ts

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,14 +82,21 @@ class AdminForthAuth implements IAdminForthAuth {
8282
username: string,
8383
pk: string | null
8484
}) {
85+
console.log("in days", expireInDays);
8586
const expiresIn: string = expireInDays ? `${expireInDays}d` : (process.env.ADMINFORTH_AUTH_EXPIRESIN || '24h');
87+
console.log("in string", expiresIn);
8688
// might be h,m,d in string
89+
8790
const expiresInSec = parseTimeToSeconds(expiresIn);
8891

92+
console.log("expiresInSec", expiresInSec);
93+
8994
const token = this.issueJWT({ username, pk}, 'auth', expiresIn);
95+
console.log("token", token);
9096
const expiresCookieFormat = new Date(Date.now() + expiresInSec * 1000).toUTCString();
91-
97+
console.log("expiresCookieFormat", expiresCookieFormat);
9298
const brandSlug = this.adminforth.config.customization.brandNameSlug;
99+
console.log("brandSlug", brandSlug);
93100
response.setHeader('Set-Cookie', `adminforth_${brandSlug}_jwt=${token}; Path=${this.adminforth.config.baseUrl || '/'}; HttpOnly; SameSite=Strict; Expires=${expiresCookieFormat}`);
94101
}
95102

adminforth/spa/src/views/ListView.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -412,7 +412,7 @@ async function init() {
412412
return {
413413
field,
414414
operator,
415-
value: JSON.parse(decodeURIComponent(route.query[k] as string))
415+
value: JSON.parse((route.query[k] as string))
416416
}
417417
});
418418
if (filters.length) {
@@ -494,7 +494,7 @@ watch(() => filtersStore.filters, async (to, from) => {
494494
const currentQ = currentQuery();
495495
filtersStore.filters.forEach(f => {
496496
if (f.value !== undefined && f.value !== null && f.value !== '') {
497-
query[`filter__${f.field}__${f.operator}`] = encodeURIComponent(JSON.stringify(f.value));
497+
query[`filter__${f.field}__${f.operator}`] = (JSON.stringify(f.value));
498498
}
499499
});
500500
// set every key in currentQ which starts with filter_ to undefined if it is not in query

0 commit comments

Comments
 (0)