fixed csrf test and a bug
This commit is contained in:
@@ -363,7 +363,7 @@ describe('CSRF Middleware', () => {
|
|||||||
|
|
||||||
expect(res.cookie).toHaveBeenCalledWith('csrf-token', 'mock-token-123', {
|
expect(res.cookie).toHaveBeenCalledWith('csrf-token', 'mock-token-123', {
|
||||||
httpOnly: true,
|
httpOnly: true,
|
||||||
secure: true,
|
secure: false,
|
||||||
sameSite: 'strict',
|
sameSite: 'strict',
|
||||||
maxAge: 60 * 60 * 1000
|
maxAge: 60 * 60 * 1000
|
||||||
});
|
});
|
||||||
@@ -376,7 +376,7 @@ describe('CSRF Middleware', () => {
|
|||||||
|
|
||||||
expect(res.cookie).toHaveBeenCalledWith('csrf-token', 'mock-token-123', {
|
expect(res.cookie).toHaveBeenCalledWith('csrf-token', 'mock-token-123', {
|
||||||
httpOnly: true,
|
httpOnly: true,
|
||||||
secure: true,
|
secure: false,
|
||||||
sameSite: 'strict',
|
sameSite: 'strict',
|
||||||
maxAge: 60 * 60 * 1000
|
maxAge: 60 * 60 * 1000
|
||||||
});
|
});
|
||||||
@@ -440,7 +440,7 @@ describe('CSRF Middleware', () => {
|
|||||||
|
|
||||||
expect(res.cookie).toHaveBeenCalledWith('csrf-token', 'mock-token-123', {
|
expect(res.cookie).toHaveBeenCalledWith('csrf-token', 'mock-token-123', {
|
||||||
httpOnly: true,
|
httpOnly: true,
|
||||||
secure: true,
|
secure: false,
|
||||||
sameSite: 'strict',
|
sameSite: 'strict',
|
||||||
maxAge: 60 * 60 * 1000
|
maxAge: 60 * 60 * 1000
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -27,7 +27,7 @@ const RecoveryCodesDisplay: React.FC<RecoveryCodesDisplayProps> = ({
|
|||||||
|
|
||||||
const handleDownload = () => {
|
const handleDownload = () => {
|
||||||
if (
|
if (
|
||||||
!confirm(
|
!window.confirm(
|
||||||
"Warning: This will create an unencrypted file on your device. " +
|
"Warning: This will create an unencrypted file on your device. " +
|
||||||
"Consider using a password manager instead. Continue?"
|
"Consider using a password manager instead. Continue?"
|
||||||
)
|
)
|
||||||
@@ -48,7 +48,7 @@ const RecoveryCodesDisplay: React.FC<RecoveryCodesDisplayProps> = ({
|
|||||||
|
|
||||||
const handlePrint = () => {
|
const handlePrint = () => {
|
||||||
if (
|
if (
|
||||||
!confirm(
|
!window.confirm(
|
||||||
"Warning: Printed documents can be easily compromised. " +
|
"Warning: Printed documents can be easily compromised. " +
|
||||||
"Consider using a password manager instead. Continue?"
|
"Consider using a password manager instead. Continue?"
|
||||||
)
|
)
|
||||||
|
|||||||
Reference in New Issue
Block a user