Skip to content

Commit

Permalink
fix: jwt save session
Browse files Browse the repository at this point in the history
  • Loading branch information
ido-pluto committed Dec 4, 2023
1 parent ff8eae7 commit ecc6c76
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions packages/forms/src/jwt-session.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { FORM_OPTIONS } from "./settings.js";
import { AstroLinkHTTP } from "./utils.js";
import {FORM_OPTIONS} from './settings.js';
import {AstroLinkHTTP} from './utils.js';
import jwt from 'jsonwebtoken';
import cookie from 'cookie';
import { deepStrictEqual } from "assert";
import {deepStrictEqual} from 'assert';

export class JWTSession {
private stringifyCookie: string
Expand All @@ -18,8 +18,8 @@ export class JWTSession {
if (!cookieContent) return;

try {
this.lastData = (<any>jwt.verify(cookieContent, FORM_OPTIONS.secret)).session || {};
this.sessionData = structuredClone(this.lastData);
this.sessionData = (<any>jwt.verify(cookieContent, FORM_OPTIONS.secret)).session || {};
this.lastData = structuredClone(this.sessionData);
} catch { }
}

Expand Down

0 comments on commit ecc6c76

Please sign in to comment.