diff options
Diffstat (limited to 'src/lib')
| -rw-r--r-- | src/lib/utils.ts | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/src/lib/utils.ts b/src/lib/utils.ts index c175986c..e2e19b05 100644 --- a/src/lib/utils.ts +++ b/src/lib/utils.ts @@ -172,11 +172,13 @@ export const login = async ( cookies.set("username", user.username, opts); cookies.set("token", token, opts); if (u.nsec) { - cookies.set("sk", bytesToHex(decrypt(u.nsec, user.password)), { - ...opts, - httpOnly: false, - sameSite: "lax", - }); + try { + cookies.set("sk", bytesToHex(decrypt(u.nsec, user.password)), { + ...opts, + httpOnly: false, + sameSite: "lax", + }); + } catch (e) {} } }; |
