diff --git a/docs/static/jsdoc/hanko-frontend-sdk/AccountConfig.html b/docs/static/jsdoc/hanko-frontend-sdk/AccountConfig.html index 7d7a010c1..bfb5ec3d5 100644 --- a/docs/static/jsdoc/hanko-frontend-sdk/AccountConfig.html +++ b/docs/static/jsdoc/hanko-frontend-sdk/AccountConfig.html @@ -66,7 +66,7 @@ @@ -125,7 +125,6 @@
Properties:
allow_deletion - allow_signup @@ -145,6 +144,29 @@
Properties:
+ + + + allow_signup + + + + + +boolean + + + + + + + + + + Indicates the current user is allowed to sign up. + + + @@ -245,4 +267,4 @@
Properties:
- + \ No newline at end of file diff --git a/docs/static/jsdoc/hanko-frontend-sdk/AuthFlowCompletedDetail.html b/docs/static/jsdoc/hanko-frontend-sdk/AuthFlowCompletedDetail.html index dd5801eed..e82a87a63 100644 --- a/docs/static/jsdoc/hanko-frontend-sdk/AuthFlowCompletedDetail.html +++ b/docs/static/jsdoc/hanko-frontend-sdk/AuthFlowCompletedDetail.html @@ -66,7 +66,7 @@ diff --git a/docs/static/jsdoc/hanko-frontend-sdk/Client.html b/docs/static/jsdoc/hanko-frontend-sdk/Client.html index 3074891e5..5e8eb24b9 100644 --- a/docs/static/jsdoc/hanko-frontend-sdk/Client.html +++ b/docs/static/jsdoc/hanko-frontend-sdk/Client.html @@ -66,7 +66,7 @@ diff --git a/docs/static/jsdoc/hanko-frontend-sdk/Config.html b/docs/static/jsdoc/hanko-frontend-sdk/Config.html index 85c2bd4ba..0cc887fa7 100644 --- a/docs/static/jsdoc/hanko-frontend-sdk/Config.html +++ b/docs/static/jsdoc/hanko-frontend-sdk/Config.html @@ -66,7 +66,7 @@ @@ -254,7 +254,7 @@
Properties:

View Source - lib/Dto.ts, line 28 + lib/Dto.ts, line 29

diff --git a/docs/static/jsdoc/hanko-frontend-sdk/ConfigClient.html b/docs/static/jsdoc/hanko-frontend-sdk/ConfigClient.html index b13e7d6d4..1e87b4c5a 100644 --- a/docs/static/jsdoc/hanko-frontend-sdk/ConfigClient.html +++ b/docs/static/jsdoc/hanko-frontend-sdk/ConfigClient.html @@ -66,7 +66,7 @@ diff --git a/docs/static/jsdoc/hanko-frontend-sdk/ConflictError.html b/docs/static/jsdoc/hanko-frontend-sdk/ConflictError.html index 53f84529c..cdf9c9e81 100644 --- a/docs/static/jsdoc/hanko-frontend-sdk/ConflictError.html +++ b/docs/static/jsdoc/hanko-frontend-sdk/ConflictError.html @@ -66,7 +66,7 @@ diff --git a/docs/static/jsdoc/hanko-frontend-sdk/Cookie.html b/docs/static/jsdoc/hanko-frontend-sdk/Cookie.html index acb019fb2..fa87c7a70 100644 --- a/docs/static/jsdoc/hanko-frontend-sdk/Cookie.html +++ b/docs/static/jsdoc/hanko-frontend-sdk/Cookie.html @@ -66,7 +66,7 @@ @@ -347,7 +347,7 @@

View Source - lib/Cookie.ts, line 57 + lib/Cookie.ts, line 66

@@ -467,7 +467,7 @@

View Source - lib/Cookie.ts, line 70 + lib/Cookie.ts, line 79

@@ -504,7 +504,7 @@

- setAuthCookie(token, secureopt) + setAuthCookie(token, options)

@@ -538,8 +538,6 @@
Parameters:
Type - Attributes - @@ -566,14 +564,6 @@
Parameters:
- - - - - - - - @@ -586,33 +576,18 @@
Parameters:
- secure + options - -boolean - - - - - - <optional>
- - - - - - - - Indicates a secure cookie should be set. Default is `true`. + @@ -660,7 +635,7 @@
Parameters:

View Source - lib/Cookie.ts, line 65 + lib/Cookie.ts, line 74

diff --git a/docs/static/jsdoc/hanko-frontend-sdk/CookieOptions.html b/docs/static/jsdoc/hanko-frontend-sdk/CookieOptions.html index 736267920..53e34c9e0 100644 --- a/docs/static/jsdoc/hanko-frontend-sdk/CookieOptions.html +++ b/docs/static/jsdoc/hanko-frontend-sdk/CookieOptions.html @@ -66,7 +66,7 @@ diff --git a/docs/static/jsdoc/hanko-frontend-sdk/Credential.html b/docs/static/jsdoc/hanko-frontend-sdk/Credential.html index c475d3ff3..4359e33d6 100644 --- a/docs/static/jsdoc/hanko-frontend-sdk/Credential.html +++ b/docs/static/jsdoc/hanko-frontend-sdk/Credential.html @@ -66,7 +66,7 @@ @@ -185,7 +185,7 @@
Properties:

View Source - lib/Dto.ts, line 71 + lib/Dto.ts, line 72

diff --git a/docs/static/jsdoc/hanko-frontend-sdk/Dispatcher.html b/docs/static/jsdoc/hanko-frontend-sdk/Dispatcher.html index 6f04c34ea..e713dd1ad 100644 --- a/docs/static/jsdoc/hanko-frontend-sdk/Dispatcher.html +++ b/docs/static/jsdoc/hanko-frontend-sdk/Dispatcher.html @@ -66,7 +66,7 @@ diff --git a/docs/static/jsdoc/hanko-frontend-sdk/DispatcherOptions.html b/docs/static/jsdoc/hanko-frontend-sdk/DispatcherOptions.html index d263c3f33..06ae99971 100644 --- a/docs/static/jsdoc/hanko-frontend-sdk/DispatcherOptions.html +++ b/docs/static/jsdoc/hanko-frontend-sdk/DispatcherOptions.html @@ -66,7 +66,7 @@ diff --git a/docs/static/jsdoc/hanko-frontend-sdk/Email.html b/docs/static/jsdoc/hanko-frontend-sdk/Email.html index cb9624500..7d55e58a2 100644 --- a/docs/static/jsdoc/hanko-frontend-sdk/Email.html +++ b/docs/static/jsdoc/hanko-frontend-sdk/Email.html @@ -66,7 +66,7 @@ @@ -277,7 +277,7 @@
Properties:

View Source - lib/Dto.ts, line 118 + lib/Dto.ts, line 119

diff --git a/docs/static/jsdoc/hanko-frontend-sdk/EmailAddressAlreadyExistsError.html b/docs/static/jsdoc/hanko-frontend-sdk/EmailAddressAlreadyExistsError.html index 91b15b761..9fb8d5293 100644 --- a/docs/static/jsdoc/hanko-frontend-sdk/EmailAddressAlreadyExistsError.html +++ b/docs/static/jsdoc/hanko-frontend-sdk/EmailAddressAlreadyExistsError.html @@ -66,7 +66,7 @@ @@ -167,7 +167,7 @@

View Source - lib/Errors.ts, line 240 + lib/Errors.ts, line 254

diff --git a/docs/static/jsdoc/hanko-frontend-sdk/EmailClient.html b/docs/static/jsdoc/hanko-frontend-sdk/EmailClient.html index 9a6aa82a8..fd1b89331 100644 --- a/docs/static/jsdoc/hanko-frontend-sdk/EmailClient.html +++ b/docs/static/jsdoc/hanko-frontend-sdk/EmailClient.html @@ -66,7 +66,7 @@ diff --git a/docs/static/jsdoc/hanko-frontend-sdk/EmailConfig.html b/docs/static/jsdoc/hanko-frontend-sdk/EmailConfig.html index 8fce5e775..3ea361970 100644 --- a/docs/static/jsdoc/hanko-frontend-sdk/EmailConfig.html +++ b/docs/static/jsdoc/hanko-frontend-sdk/EmailConfig.html @@ -66,7 +66,7 @@ diff --git a/docs/static/jsdoc/hanko-frontend-sdk/Emails.html b/docs/static/jsdoc/hanko-frontend-sdk/Emails.html index 6e04eac89..5f4edbe8c 100644 --- a/docs/static/jsdoc/hanko-frontend-sdk/Emails.html +++ b/docs/static/jsdoc/hanko-frontend-sdk/Emails.html @@ -66,7 +66,7 @@ @@ -181,7 +181,7 @@

Properties:

View Source - lib/Dto.ts, line 129 + lib/Dto.ts, line 130

diff --git a/docs/static/jsdoc/hanko-frontend-sdk/ForbiddenError.html b/docs/static/jsdoc/hanko-frontend-sdk/ForbiddenError.html new file mode 100644 index 000000000..5c63cddd8 --- /dev/null +++ b/docs/static/jsdoc/hanko-frontend-sdk/ForbiddenError.html @@ -0,0 +1,428 @@ + + + + + + + + ForbiddenError + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + +
+
+
+ +
+
+
+

Class

+

ForbiddenError

+
+ + + + + +
+ +
+ +

ForbiddenError()

+ +
A 'ForbiddenError' occurs when the user is not allowed to perform the requested action.
+ + +
+ +
+
+ + +
+
+
+
+ Constructor +
+ + + + +

+ # + + + + new ForbiddenError() + + +

+ + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

+ View Source + + lib/Errors.ts, line 210 + +

+ +
+ + + + + + + + + + + + + + + + + + + + + + +
+
+
+ + +
+ + +

Extends

+ + + + + + + + + + + + + + + + + + + + +
+

Members

+
+ +
+ + + + +Error + + + + +

+ # + + + cause + + + Optional + +

+ + + + + + + + +
+ + + + + + + + +
Overrides:
+
+ + + + + + + + + + + + + + + + + + + + + + + + +

+ View Source + + lib/Errors.ts, line 27 + +

+ +
+ + + + + +
+ +
+ + + + +string + + + + +

+ # + + + code + + +

+ + + + + + + + +
+ + + + + + + + +
Overrides:
+
+ + + + + + + + + + + + + + + + + + + + + + + + +

+ View Source + + lib/Errors.ts, line 22 + +

+ +
+ + + + + +
+ +
+
+ + + + + + + +
+ +
+ + + + +
+ + + +
+
+
+
+ + + + + + + \ No newline at end of file diff --git a/docs/static/jsdoc/hanko-frontend-sdk/Hanko.html b/docs/static/jsdoc/hanko-frontend-sdk/Hanko.html index 22df6bf04..b669a1a15 100644 --- a/docs/static/jsdoc/hanko-frontend-sdk/Hanko.html +++ b/docs/static/jsdoc/hanko-frontend-sdk/Hanko.html @@ -66,7 +66,7 @@ diff --git a/docs/static/jsdoc/hanko-frontend-sdk/Hanko.ts.html b/docs/static/jsdoc/hanko-frontend-sdk/Hanko.ts.html index 76c11669c..eae1dc7e9 100644 --- a/docs/static/jsdoc/hanko-frontend-sdk/Hanko.ts.html +++ b/docs/static/jsdoc/hanko-frontend-sdk/Hanko.ts.html @@ -68,7 +68,7 @@ diff --git a/docs/static/jsdoc/hanko-frontend-sdk/HankoError.html b/docs/static/jsdoc/hanko-frontend-sdk/HankoError.html index 69f818130..b4b5645f4 100644 --- a/docs/static/jsdoc/hanko-frontend-sdk/HankoError.html +++ b/docs/static/jsdoc/hanko-frontend-sdk/HankoError.html @@ -66,7 +66,7 @@ diff --git a/docs/static/jsdoc/hanko-frontend-sdk/HankoOptions.html b/docs/static/jsdoc/hanko-frontend-sdk/HankoOptions.html index cd70067d3..93d9f01e2 100644 --- a/docs/static/jsdoc/hanko-frontend-sdk/HankoOptions.html +++ b/docs/static/jsdoc/hanko-frontend-sdk/HankoOptions.html @@ -66,7 +66,7 @@ diff --git a/docs/static/jsdoc/hanko-frontend-sdk/Headers.html b/docs/static/jsdoc/hanko-frontend-sdk/Headers.html index 1557fb2a8..205fb1d29 100644 --- a/docs/static/jsdoc/hanko-frontend-sdk/Headers.html +++ b/docs/static/jsdoc/hanko-frontend-sdk/Headers.html @@ -66,7 +66,7 @@ @@ -398,7 +398,7 @@
Parameters:

View Source - lib/client/HttpClient.ts, line 285 + lib/client/HttpClient.ts, line 286

diff --git a/docs/static/jsdoc/hanko-frontend-sdk/HttpClient.html b/docs/static/jsdoc/hanko-frontend-sdk/HttpClient.html index d96ebec4b..c29160ae4 100644 --- a/docs/static/jsdoc/hanko-frontend-sdk/HttpClient.html +++ b/docs/static/jsdoc/hanko-frontend-sdk/HttpClient.html @@ -66,7 +66,7 @@ @@ -422,7 +422,7 @@
Parameters:

View Source - lib/client/HttpClient.ts, line 375 + lib/client/HttpClient.ts, line 376

@@ -630,7 +630,7 @@
Parameters:

View Source - lib/client/HttpClient.ts, line 332 + lib/client/HttpClient.ts, line 333

@@ -883,7 +883,7 @@
Parameters:

View Source - lib/client/HttpClient.ts, line 365 + lib/client/HttpClient.ts, line 366

@@ -1136,7 +1136,7 @@
Parameters:

View Source - lib/client/HttpClient.ts, line 343 + lib/client/HttpClient.ts, line 344

@@ -1370,7 +1370,7 @@
Parameters:

View Source - lib/client/HttpClient.ts, line 322 + lib/client/HttpClient.ts, line 323

@@ -1563,7 +1563,7 @@
Parameters:

View Source - lib/client/HttpClient.ts, line 354 + lib/client/HttpClient.ts, line 355

diff --git a/docs/static/jsdoc/hanko-frontend-sdk/HttpClientOptions.html b/docs/static/jsdoc/hanko-frontend-sdk/HttpClientOptions.html index 52a6d7e2c..b265f5182 100644 --- a/docs/static/jsdoc/hanko-frontend-sdk/HttpClientOptions.html +++ b/docs/static/jsdoc/hanko-frontend-sdk/HttpClientOptions.html @@ -66,7 +66,7 @@ @@ -233,7 +233,7 @@
Properties:

View Source - lib/client/HttpClient.ts, line 303 + lib/client/HttpClient.ts, line 304

diff --git a/docs/static/jsdoc/hanko-frontend-sdk/Identity.html b/docs/static/jsdoc/hanko-frontend-sdk/Identity.html index 35d100574..045aa656a 100644 --- a/docs/static/jsdoc/hanko-frontend-sdk/Identity.html +++ b/docs/static/jsdoc/hanko-frontend-sdk/Identity.html @@ -66,7 +66,7 @@ @@ -202,7 +202,7 @@
Properties:

View Source - lib/Dto.ts, line 157 + lib/Dto.ts, line 158

diff --git a/docs/static/jsdoc/hanko-frontend-sdk/InvalidPasscodeError.html b/docs/static/jsdoc/hanko-frontend-sdk/InvalidPasscodeError.html index d7f4840f3..f70d88802 100644 --- a/docs/static/jsdoc/hanko-frontend-sdk/InvalidPasscodeError.html +++ b/docs/static/jsdoc/hanko-frontend-sdk/InvalidPasscodeError.html @@ -66,7 +66,7 @@ diff --git a/docs/static/jsdoc/hanko-frontend-sdk/InvalidPasswordError.html b/docs/static/jsdoc/hanko-frontend-sdk/InvalidPasswordError.html index 6824d93c3..ccbff608a 100644 --- a/docs/static/jsdoc/hanko-frontend-sdk/InvalidPasswordError.html +++ b/docs/static/jsdoc/hanko-frontend-sdk/InvalidPasswordError.html @@ -66,7 +66,7 @@ diff --git a/docs/static/jsdoc/hanko-frontend-sdk/InvalidWebauthnCredentialError.html b/docs/static/jsdoc/hanko-frontend-sdk/InvalidWebauthnCredentialError.html index bd0b6f2fa..b672b9a3d 100644 --- a/docs/static/jsdoc/hanko-frontend-sdk/InvalidWebauthnCredentialError.html +++ b/docs/static/jsdoc/hanko-frontend-sdk/InvalidWebauthnCredentialError.html @@ -66,7 +66,7 @@ diff --git a/docs/static/jsdoc/hanko-frontend-sdk/Listener.html b/docs/static/jsdoc/hanko-frontend-sdk/Listener.html index d76845f5c..3c0b09325 100644 --- a/docs/static/jsdoc/hanko-frontend-sdk/Listener.html +++ b/docs/static/jsdoc/hanko-frontend-sdk/Listener.html @@ -66,7 +66,7 @@ diff --git a/docs/static/jsdoc/hanko-frontend-sdk/LocalStorage.html b/docs/static/jsdoc/hanko-frontend-sdk/LocalStorage.html index c91fc005c..0019db7c8 100644 --- a/docs/static/jsdoc/hanko-frontend-sdk/LocalStorage.html +++ b/docs/static/jsdoc/hanko-frontend-sdk/LocalStorage.html @@ -66,7 +66,7 @@ diff --git a/docs/static/jsdoc/hanko-frontend-sdk/LocalStoragePasscode.html b/docs/static/jsdoc/hanko-frontend-sdk/LocalStoragePasscode.html index 6b8e766a4..c1fa7dbc7 100644 --- a/docs/static/jsdoc/hanko-frontend-sdk/LocalStoragePasscode.html +++ b/docs/static/jsdoc/hanko-frontend-sdk/LocalStoragePasscode.html @@ -66,7 +66,7 @@ diff --git a/docs/static/jsdoc/hanko-frontend-sdk/LocalStoragePassword.html b/docs/static/jsdoc/hanko-frontend-sdk/LocalStoragePassword.html index 2f3ca7dc6..42df4e2fd 100644 --- a/docs/static/jsdoc/hanko-frontend-sdk/LocalStoragePassword.html +++ b/docs/static/jsdoc/hanko-frontend-sdk/LocalStoragePassword.html @@ -66,7 +66,7 @@ diff --git a/docs/static/jsdoc/hanko-frontend-sdk/LocalStorageSession.html b/docs/static/jsdoc/hanko-frontend-sdk/LocalStorageSession.html index 17cda0d1f..d0325f6cd 100644 --- a/docs/static/jsdoc/hanko-frontend-sdk/LocalStorageSession.html +++ b/docs/static/jsdoc/hanko-frontend-sdk/LocalStorageSession.html @@ -66,7 +66,7 @@ diff --git a/docs/static/jsdoc/hanko-frontend-sdk/LocalStorageUser.html b/docs/static/jsdoc/hanko-frontend-sdk/LocalStorageUser.html index 579dc5194..0a28d313a 100644 --- a/docs/static/jsdoc/hanko-frontend-sdk/LocalStorageUser.html +++ b/docs/static/jsdoc/hanko-frontend-sdk/LocalStorageUser.html @@ -66,7 +66,7 @@ diff --git a/docs/static/jsdoc/hanko-frontend-sdk/LocalStorageUsers.html b/docs/static/jsdoc/hanko-frontend-sdk/LocalStorageUsers.html index 6c1608652..339abc71e 100644 --- a/docs/static/jsdoc/hanko-frontend-sdk/LocalStorageUsers.html +++ b/docs/static/jsdoc/hanko-frontend-sdk/LocalStorageUsers.html @@ -66,7 +66,7 @@ diff --git a/docs/static/jsdoc/hanko-frontend-sdk/LocalStorageWebauthn.html b/docs/static/jsdoc/hanko-frontend-sdk/LocalStorageWebauthn.html index 5029842dd..9c7356dc9 100644 --- a/docs/static/jsdoc/hanko-frontend-sdk/LocalStorageWebauthn.html +++ b/docs/static/jsdoc/hanko-frontend-sdk/LocalStorageWebauthn.html @@ -66,7 +66,7 @@ diff --git a/docs/static/jsdoc/hanko-frontend-sdk/MaxNumOfEmailAddressesReachedError.html b/docs/static/jsdoc/hanko-frontend-sdk/MaxNumOfEmailAddressesReachedError.html index 006a81e21..4a24073b7 100644 --- a/docs/static/jsdoc/hanko-frontend-sdk/MaxNumOfEmailAddressesReachedError.html +++ b/docs/static/jsdoc/hanko-frontend-sdk/MaxNumOfEmailAddressesReachedError.html @@ -66,7 +66,7 @@ @@ -168,7 +168,7 @@

View Source - lib/Errors.ts, line 226 + lib/Errors.ts, line 240

diff --git a/docs/static/jsdoc/hanko-frontend-sdk/MaxNumOfPasscodeAttemptsReachedError.html b/docs/static/jsdoc/hanko-frontend-sdk/MaxNumOfPasscodeAttemptsReachedError.html index 266daa0ab..680dff598 100644 --- a/docs/static/jsdoc/hanko-frontend-sdk/MaxNumOfPasscodeAttemptsReachedError.html +++ b/docs/static/jsdoc/hanko-frontend-sdk/MaxNumOfPasscodeAttemptsReachedError.html @@ -66,7 +66,7 @@ diff --git a/docs/static/jsdoc/hanko-frontend-sdk/NotFoundError.html b/docs/static/jsdoc/hanko-frontend-sdk/NotFoundError.html index 01142cbb7..ede4775f1 100644 --- a/docs/static/jsdoc/hanko-frontend-sdk/NotFoundError.html +++ b/docs/static/jsdoc/hanko-frontend-sdk/NotFoundError.html @@ -66,7 +66,7 @@ diff --git a/docs/static/jsdoc/hanko-frontend-sdk/Passcode.html b/docs/static/jsdoc/hanko-frontend-sdk/Passcode.html index dd967664d..90c4238b4 100644 --- a/docs/static/jsdoc/hanko-frontend-sdk/Passcode.html +++ b/docs/static/jsdoc/hanko-frontend-sdk/Passcode.html @@ -66,7 +66,7 @@ @@ -208,7 +208,7 @@

Properties:

View Source - lib/Dto.ts, line 95 + lib/Dto.ts, line 96

diff --git a/docs/static/jsdoc/hanko-frontend-sdk/PasscodeClient.html b/docs/static/jsdoc/hanko-frontend-sdk/PasscodeClient.html index 6fa8293d3..1ab7e4da1 100644 --- a/docs/static/jsdoc/hanko-frontend-sdk/PasscodeClient.html +++ b/docs/static/jsdoc/hanko-frontend-sdk/PasscodeClient.html @@ -66,7 +66,7 @@ diff --git a/docs/static/jsdoc/hanko-frontend-sdk/PasscodeExpiredError.html b/docs/static/jsdoc/hanko-frontend-sdk/PasscodeExpiredError.html index 734899ca7..76c22c1c7 100644 --- a/docs/static/jsdoc/hanko-frontend-sdk/PasscodeExpiredError.html +++ b/docs/static/jsdoc/hanko-frontend-sdk/PasscodeExpiredError.html @@ -66,7 +66,7 @@ diff --git a/docs/static/jsdoc/hanko-frontend-sdk/PasscodeState.html b/docs/static/jsdoc/hanko-frontend-sdk/PasscodeState.html index a5f6c80c2..0ac53d7a2 100644 --- a/docs/static/jsdoc/hanko-frontend-sdk/PasscodeState.html +++ b/docs/static/jsdoc/hanko-frontend-sdk/PasscodeState.html @@ -66,7 +66,7 @@ diff --git a/docs/static/jsdoc/hanko-frontend-sdk/PasswordClient.html b/docs/static/jsdoc/hanko-frontend-sdk/PasswordClient.html index b77589d91..046a37a52 100644 --- a/docs/static/jsdoc/hanko-frontend-sdk/PasswordClient.html +++ b/docs/static/jsdoc/hanko-frontend-sdk/PasswordClient.html @@ -66,7 +66,7 @@ diff --git a/docs/static/jsdoc/hanko-frontend-sdk/PasswordConfig.html b/docs/static/jsdoc/hanko-frontend-sdk/PasswordConfig.html index 88cf36f5e..6a95c92d0 100644 --- a/docs/static/jsdoc/hanko-frontend-sdk/PasswordConfig.html +++ b/docs/static/jsdoc/hanko-frontend-sdk/PasswordConfig.html @@ -66,7 +66,7 @@ diff --git a/docs/static/jsdoc/hanko-frontend-sdk/PasswordState.html b/docs/static/jsdoc/hanko-frontend-sdk/PasswordState.html index 0e60b3783..7bc99c6a1 100644 --- a/docs/static/jsdoc/hanko-frontend-sdk/PasswordState.html +++ b/docs/static/jsdoc/hanko-frontend-sdk/PasswordState.html @@ -66,7 +66,7 @@ diff --git a/docs/static/jsdoc/hanko-frontend-sdk/Relay.html b/docs/static/jsdoc/hanko-frontend-sdk/Relay.html index fbec79bb0..77bf0e89b 100644 --- a/docs/static/jsdoc/hanko-frontend-sdk/Relay.html +++ b/docs/static/jsdoc/hanko-frontend-sdk/Relay.html @@ -66,7 +66,7 @@ diff --git a/docs/static/jsdoc/hanko-frontend-sdk/RelayOptions.html b/docs/static/jsdoc/hanko-frontend-sdk/RelayOptions.html index 194edded9..f04d845c7 100644 --- a/docs/static/jsdoc/hanko-frontend-sdk/RelayOptions.html +++ b/docs/static/jsdoc/hanko-frontend-sdk/RelayOptions.html @@ -66,7 +66,7 @@ diff --git a/docs/static/jsdoc/hanko-frontend-sdk/RequestTimeoutError.html b/docs/static/jsdoc/hanko-frontend-sdk/RequestTimeoutError.html index d435986a9..ebaf9d9d9 100644 --- a/docs/static/jsdoc/hanko-frontend-sdk/RequestTimeoutError.html +++ b/docs/static/jsdoc/hanko-frontend-sdk/RequestTimeoutError.html @@ -66,7 +66,7 @@ diff --git a/docs/static/jsdoc/hanko-frontend-sdk/Response.html b/docs/static/jsdoc/hanko-frontend-sdk/Response.html index 9a7b70b9d..4d6167679 100644 --- a/docs/static/jsdoc/hanko-frontend-sdk/Response.html +++ b/docs/static/jsdoc/hanko-frontend-sdk/Response.html @@ -66,7 +66,7 @@ @@ -719,7 +719,7 @@

View Source - lib/client/HttpClient.ts, line 293 + lib/client/HttpClient.ts, line 294

@@ -891,7 +891,7 @@

Parameters:

View Source - lib/client/HttpClient.ts, line 302 + lib/client/HttpClient.ts, line 303

diff --git a/docs/static/jsdoc/hanko-frontend-sdk/Scheduler.html b/docs/static/jsdoc/hanko-frontend-sdk/Scheduler.html index 458b3daaa..ce0f58532 100644 --- a/docs/static/jsdoc/hanko-frontend-sdk/Scheduler.html +++ b/docs/static/jsdoc/hanko-frontend-sdk/Scheduler.html @@ -66,7 +66,7 @@ diff --git a/docs/static/jsdoc/hanko-frontend-sdk/Session.html b/docs/static/jsdoc/hanko-frontend-sdk/Session.html index 7bb08bad7..a4d944e77 100644 --- a/docs/static/jsdoc/hanko-frontend-sdk/Session.html +++ b/docs/static/jsdoc/hanko-frontend-sdk/Session.html @@ -66,7 +66,7 @@ diff --git a/docs/static/jsdoc/hanko-frontend-sdk/SessionDetail.html b/docs/static/jsdoc/hanko-frontend-sdk/SessionDetail.html index f4da1db3a..b4c5f023e 100644 --- a/docs/static/jsdoc/hanko-frontend-sdk/SessionDetail.html +++ b/docs/static/jsdoc/hanko-frontend-sdk/SessionDetail.html @@ -66,7 +66,7 @@ diff --git a/docs/static/jsdoc/hanko-frontend-sdk/SessionOptions.html b/docs/static/jsdoc/hanko-frontend-sdk/SessionOptions.html index 9dd4d3357..ac13a8840 100644 --- a/docs/static/jsdoc/hanko-frontend-sdk/SessionOptions.html +++ b/docs/static/jsdoc/hanko-frontend-sdk/SessionOptions.html @@ -66,7 +66,7 @@ diff --git a/docs/static/jsdoc/hanko-frontend-sdk/SessionState.html b/docs/static/jsdoc/hanko-frontend-sdk/SessionState.html index 98e80f4af..f49f5de28 100644 --- a/docs/static/jsdoc/hanko-frontend-sdk/SessionState.html +++ b/docs/static/jsdoc/hanko-frontend-sdk/SessionState.html @@ -66,7 +66,7 @@ diff --git a/docs/static/jsdoc/hanko-frontend-sdk/SessionStateOptions.html b/docs/static/jsdoc/hanko-frontend-sdk/SessionStateOptions.html index 787746c79..279476c05 100644 --- a/docs/static/jsdoc/hanko-frontend-sdk/SessionStateOptions.html +++ b/docs/static/jsdoc/hanko-frontend-sdk/SessionStateOptions.html @@ -66,7 +66,7 @@ diff --git a/docs/static/jsdoc/hanko-frontend-sdk/SetAuthCookieOptions.html b/docs/static/jsdoc/hanko-frontend-sdk/SetAuthCookieOptions.html new file mode 100644 index 000000000..d630a9290 --- /dev/null +++ b/docs/static/jsdoc/hanko-frontend-sdk/SetAuthCookieOptions.html @@ -0,0 +1,278 @@ + + + + + + + + SetAuthCookieOptions + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + +
+
+
+ +
+
+
+

Interface

+

SetAuthCookieOptions

+
+ + + + + +
+ +
+ +

SetAuthCookieOptions

+ + +
+ +
+
+ + +
Options for setting the auth cookie.
+ + + + + +
Properties:
+ + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
secure + + +boolean + + + + Indicates if the Secure attribute of the cookie should be set.
expires + + +number +| + +Date +| + +undefined + + + + The expiration of the cookie.
+
+ + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

+ View Source + + lib/Cookie.ts, line 50 + +

+ +
+ + + + +
+ + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + + +
+
+
+
+ + + + + + + \ No newline at end of file diff --git a/docs/static/jsdoc/hanko-frontend-sdk/State.html b/docs/static/jsdoc/hanko-frontend-sdk/State.html index 76906ccf1..c86202a68 100644 --- a/docs/static/jsdoc/hanko-frontend-sdk/State.html +++ b/docs/static/jsdoc/hanko-frontend-sdk/State.html @@ -66,7 +66,7 @@ diff --git a/docs/static/jsdoc/hanko-frontend-sdk/TechnicalError.html b/docs/static/jsdoc/hanko-frontend-sdk/TechnicalError.html index 74733d5c6..813bc5918 100644 --- a/docs/static/jsdoc/hanko-frontend-sdk/TechnicalError.html +++ b/docs/static/jsdoc/hanko-frontend-sdk/TechnicalError.html @@ -66,7 +66,7 @@ diff --git a/docs/static/jsdoc/hanko-frontend-sdk/ThirdPartyClient.html b/docs/static/jsdoc/hanko-frontend-sdk/ThirdPartyClient.html index 04582a36f..3308ccc0f 100644 --- a/docs/static/jsdoc/hanko-frontend-sdk/ThirdPartyClient.html +++ b/docs/static/jsdoc/hanko-frontend-sdk/ThirdPartyClient.html @@ -66,7 +66,7 @@ diff --git a/docs/static/jsdoc/hanko-frontend-sdk/ThirdPartyError.html b/docs/static/jsdoc/hanko-frontend-sdk/ThirdPartyError.html index 731290496..57bdef65c 100644 --- a/docs/static/jsdoc/hanko-frontend-sdk/ThirdPartyError.html +++ b/docs/static/jsdoc/hanko-frontend-sdk/ThirdPartyError.html @@ -66,7 +66,7 @@ @@ -168,7 +168,7 @@

View Source - lib/Errors.ts, line 255 + lib/Errors.ts, line 269

diff --git a/docs/static/jsdoc/hanko-frontend-sdk/Throttle.html b/docs/static/jsdoc/hanko-frontend-sdk/Throttle.html index 71b11939b..af03896b0 100644 --- a/docs/static/jsdoc/hanko-frontend-sdk/Throttle.html +++ b/docs/static/jsdoc/hanko-frontend-sdk/Throttle.html @@ -66,7 +66,7 @@ diff --git a/docs/static/jsdoc/hanko-frontend-sdk/ThrottleOptions.html b/docs/static/jsdoc/hanko-frontend-sdk/ThrottleOptions.html index 754154bce..21fd1b69c 100644 --- a/docs/static/jsdoc/hanko-frontend-sdk/ThrottleOptions.html +++ b/docs/static/jsdoc/hanko-frontend-sdk/ThrottleOptions.html @@ -66,7 +66,7 @@ diff --git a/docs/static/jsdoc/hanko-frontend-sdk/TokenClient.html b/docs/static/jsdoc/hanko-frontend-sdk/TokenClient.html index c78632960..ce3fcf419 100644 --- a/docs/static/jsdoc/hanko-frontend-sdk/TokenClient.html +++ b/docs/static/jsdoc/hanko-frontend-sdk/TokenClient.html @@ -66,7 +66,7 @@ diff --git a/docs/static/jsdoc/hanko-frontend-sdk/TokenFinalized.html b/docs/static/jsdoc/hanko-frontend-sdk/TokenFinalized.html index 06609aee1..020459bea 100644 --- a/docs/static/jsdoc/hanko-frontend-sdk/TokenFinalized.html +++ b/docs/static/jsdoc/hanko-frontend-sdk/TokenFinalized.html @@ -66,7 +66,7 @@ @@ -185,7 +185,7 @@

Properties:

View Source - lib/Dto.ts, line 46 + lib/Dto.ts, line 47

diff --git a/docs/static/jsdoc/hanko-frontend-sdk/TooManyRequestsError.html b/docs/static/jsdoc/hanko-frontend-sdk/TooManyRequestsError.html index 0d5117d39..c9f216586 100644 --- a/docs/static/jsdoc/hanko-frontend-sdk/TooManyRequestsError.html +++ b/docs/static/jsdoc/hanko-frontend-sdk/TooManyRequestsError.html @@ -66,7 +66,7 @@ diff --git a/docs/static/jsdoc/hanko-frontend-sdk/UnauthorizedError.html b/docs/static/jsdoc/hanko-frontend-sdk/UnauthorizedError.html index 3957807fe..79ddc2b58 100644 --- a/docs/static/jsdoc/hanko-frontend-sdk/UnauthorizedError.html +++ b/docs/static/jsdoc/hanko-frontend-sdk/UnauthorizedError.html @@ -66,7 +66,7 @@ diff --git a/docs/static/jsdoc/hanko-frontend-sdk/User.html b/docs/static/jsdoc/hanko-frontend-sdk/User.html index bc3d4c3ee..db83f2faa 100644 --- a/docs/static/jsdoc/hanko-frontend-sdk/User.html +++ b/docs/static/jsdoc/hanko-frontend-sdk/User.html @@ -66,7 +66,7 @@ @@ -231,7 +231,7 @@
Properties:

View Source - lib/Dto.ts, line 78 + lib/Dto.ts, line 79

diff --git a/docs/static/jsdoc/hanko-frontend-sdk/UserClient.html b/docs/static/jsdoc/hanko-frontend-sdk/UserClient.html index 92862a14f..13d1ef6ae 100644 --- a/docs/static/jsdoc/hanko-frontend-sdk/UserClient.html +++ b/docs/static/jsdoc/hanko-frontend-sdk/UserClient.html @@ -66,7 +66,7 @@ @@ -448,7 +448,7 @@
Parameters:

View Source - lib/client/UserClient.ts, line 169 + lib/client/UserClient.ts, line 172

@@ -624,7 +624,7 @@

View Source - lib/client/UserClient.ts, line 193 + lib/client/UserClient.ts, line 196

@@ -809,7 +809,7 @@

View Source - lib/client/UserClient.ts, line 182 + lib/client/UserClient.ts, line 185

@@ -1045,7 +1045,7 @@

Parameters:

View Source - lib/client/UserClient.ts, line 155 + lib/client/UserClient.ts, line 158

@@ -1221,7 +1221,7 @@

View Source - lib/client/UserClient.ts, line 203 + lib/client/UserClient.ts, line 206

diff --git a/docs/static/jsdoc/hanko-frontend-sdk/UserCreated.html b/docs/static/jsdoc/hanko-frontend-sdk/UserCreated.html index 906539d56..d19eeff20 100644 --- a/docs/static/jsdoc/hanko-frontend-sdk/UserCreated.html +++ b/docs/static/jsdoc/hanko-frontend-sdk/UserCreated.html @@ -66,7 +66,7 @@ @@ -208,7 +208,7 @@

Properties:

View Source - lib/Dto.ts, line 87 + lib/Dto.ts, line 88

diff --git a/docs/static/jsdoc/hanko-frontend-sdk/UserInfo.html b/docs/static/jsdoc/hanko-frontend-sdk/UserInfo.html index eab792e0f..ef52347e0 100644 --- a/docs/static/jsdoc/hanko-frontend-sdk/UserInfo.html +++ b/docs/static/jsdoc/hanko-frontend-sdk/UserInfo.html @@ -66,7 +66,7 @@ @@ -254,7 +254,7 @@
Properties:

View Source - lib/Dto.ts, line 53 + lib/Dto.ts, line 54

diff --git a/docs/static/jsdoc/hanko-frontend-sdk/UserState.html b/docs/static/jsdoc/hanko-frontend-sdk/UserState.html index a61e63a89..2ab73f997 100644 --- a/docs/static/jsdoc/hanko-frontend-sdk/UserState.html +++ b/docs/static/jsdoc/hanko-frontend-sdk/UserState.html @@ -66,7 +66,7 @@ diff --git a/docs/static/jsdoc/hanko-frontend-sdk/UserVerificationError.html b/docs/static/jsdoc/hanko-frontend-sdk/UserVerificationError.html index 262ddb13b..2772febb4 100644 --- a/docs/static/jsdoc/hanko-frontend-sdk/UserVerificationError.html +++ b/docs/static/jsdoc/hanko-frontend-sdk/UserVerificationError.html @@ -66,7 +66,7 @@ @@ -168,7 +168,7 @@

View Source - lib/Errors.ts, line 211 + lib/Errors.ts, line 225

diff --git a/docs/static/jsdoc/hanko-frontend-sdk/WebauthnClient.html b/docs/static/jsdoc/hanko-frontend-sdk/WebauthnClient.html index 6b117b469..88aead4d6 100644 --- a/docs/static/jsdoc/hanko-frontend-sdk/WebauthnClient.html +++ b/docs/static/jsdoc/hanko-frontend-sdk/WebauthnClient.html @@ -66,7 +66,7 @@ diff --git a/docs/static/jsdoc/hanko-frontend-sdk/WebauthnCredential.html b/docs/static/jsdoc/hanko-frontend-sdk/WebauthnCredential.html index f27b93b3a..885f1cbf8 100644 --- a/docs/static/jsdoc/hanko-frontend-sdk/WebauthnCredential.html +++ b/docs/static/jsdoc/hanko-frontend-sdk/WebauthnCredential.html @@ -66,7 +66,7 @@ @@ -398,7 +398,7 @@

Properties:

View Source - lib/Dto.ts, line 136 + lib/Dto.ts, line 137

diff --git a/docs/static/jsdoc/hanko-frontend-sdk/WebauthnCredentials.html b/docs/static/jsdoc/hanko-frontend-sdk/WebauthnCredentials.html index 3315199e8..27fb7ad26 100644 --- a/docs/static/jsdoc/hanko-frontend-sdk/WebauthnCredentials.html +++ b/docs/static/jsdoc/hanko-frontend-sdk/WebauthnCredentials.html @@ -66,7 +66,7 @@ @@ -181,7 +181,7 @@
Properties:

View Source - lib/Dto.ts, line 150 + lib/Dto.ts, line 151

diff --git a/docs/static/jsdoc/hanko-frontend-sdk/WebauthnFinalized.html b/docs/static/jsdoc/hanko-frontend-sdk/WebauthnFinalized.html index 2973ae9f7..5e901c8f7 100644 --- a/docs/static/jsdoc/hanko-frontend-sdk/WebauthnFinalized.html +++ b/docs/static/jsdoc/hanko-frontend-sdk/WebauthnFinalized.html @@ -66,7 +66,7 @@ @@ -208,7 +208,7 @@
Properties:

View Source - lib/Dto.ts, line 38 + lib/Dto.ts, line 39

diff --git a/docs/static/jsdoc/hanko-frontend-sdk/WebauthnRequestCancelledError.html b/docs/static/jsdoc/hanko-frontend-sdk/WebauthnRequestCancelledError.html index 3a1179476..46ebe1186 100644 --- a/docs/static/jsdoc/hanko-frontend-sdk/WebauthnRequestCancelledError.html +++ b/docs/static/jsdoc/hanko-frontend-sdk/WebauthnRequestCancelledError.html @@ -66,7 +66,7 @@ diff --git a/docs/static/jsdoc/hanko-frontend-sdk/WebauthnState.html b/docs/static/jsdoc/hanko-frontend-sdk/WebauthnState.html index b3486d7a6..7420da49f 100644 --- a/docs/static/jsdoc/hanko-frontend-sdk/WebauthnState.html +++ b/docs/static/jsdoc/hanko-frontend-sdk/WebauthnState.html @@ -66,7 +66,7 @@ diff --git a/docs/static/jsdoc/hanko-frontend-sdk/WebauthnSupport.html b/docs/static/jsdoc/hanko-frontend-sdk/WebauthnSupport.html index 999f7ceec..2aee27015 100644 --- a/docs/static/jsdoc/hanko-frontend-sdk/WebauthnSupport.html +++ b/docs/static/jsdoc/hanko-frontend-sdk/WebauthnSupport.html @@ -66,7 +66,7 @@ diff --git a/docs/static/jsdoc/hanko-frontend-sdk/WebauthnTransports.html b/docs/static/jsdoc/hanko-frontend-sdk/WebauthnTransports.html index 7f1d6cd85..0e6218b85 100644 --- a/docs/static/jsdoc/hanko-frontend-sdk/WebauthnTransports.html +++ b/docs/static/jsdoc/hanko-frontend-sdk/WebauthnTransports.html @@ -66,7 +66,7 @@ @@ -181,7 +181,7 @@
Properties:

View Source - lib/Dto.ts, line 103 + lib/Dto.ts, line 104

diff --git a/docs/static/jsdoc/hanko-frontend-sdk/index.html b/docs/static/jsdoc/hanko-frontend-sdk/index.html index a1428ce4b..da06863a1 100644 --- a/docs/static/jsdoc/hanko-frontend-sdk/index.html +++ b/docs/static/jsdoc/hanko-frontend-sdk/index.html @@ -66,7 +66,7 @@ diff --git a/docs/static/jsdoc/hanko-frontend-sdk/lib_Cookie.ts.html b/docs/static/jsdoc/hanko-frontend-sdk/lib_Cookie.ts.html index fea8df89e..d8e036869 100644 --- a/docs/static/jsdoc/hanko-frontend-sdk/lib_Cookie.ts.html +++ b/docs/static/jsdoc/hanko-frontend-sdk/lib_Cookie.ts.html @@ -68,7 +68,7 @@ @@ -98,6 +98,19 @@

lib/Cookie.ts

cookieName: string; } +/** + * Options for setting the auth cookie. + * + * @category SDK + * @subcategory Internal + * @property {boolean} secure - Indicates if the Secure attribute of the cookie should be set. + * @property {number | Date | undefined} expires - The expiration of the cookie. + */ +interface SetAuthCookieOptions { + secure?: boolean; + expires?: number | Date | undefined; +} + /** * A class to manage cookies. * @@ -126,10 +139,13 @@

lib/Cookie.ts

* Stores the authentication token to the cookie. * * @param {string} token - The authentication token to be stored. - * @param {boolean=} secure - Indicates a secure cookie should be set. Default is `true`. + * @param options */ - setAuthCookie(token: string, secure = true) { - JSCookie.set(this.authCookieName, token, { secure }); + setAuthCookie( + token: string, + options: SetAuthCookieOptions = { secure: true }, + ) { + JSCookie.set(this.authCookieName, token, options); } /** diff --git a/docs/static/jsdoc/hanko-frontend-sdk/lib_Dto.ts.html b/docs/static/jsdoc/hanko-frontend-sdk/lib_Dto.ts.html index 3207d00d7..105e7841f 100644 --- a/docs/static/jsdoc/hanko-frontend-sdk/lib_Dto.ts.html +++ b/docs/static/jsdoc/hanko-frontend-sdk/lib_Dto.ts.html @@ -68,7 +68,7 @@ @@ -116,9 +116,11 @@

lib/Dto.ts

* @category SDK * @subcategory DTO * @property {boolean} allow_deletion - Indicates the current user is allowed to delete the account. + * @property {boolean} allow_signup - Indicates the current user is allowed to sign up. */ export interface AccountConfig { allow_deletion: boolean; + allow_signup: boolean; } /** diff --git a/docs/static/jsdoc/hanko-frontend-sdk/lib_Errors.ts.html b/docs/static/jsdoc/hanko-frontend-sdk/lib_Errors.ts.html index 315605a40..6fe41d9d7 100644 --- a/docs/static/jsdoc/hanko-frontend-sdk/lib_Errors.ts.html +++ b/docs/static/jsdoc/hanko-frontend-sdk/lib_Errors.ts.html @@ -68,7 +68,7 @@ @@ -308,6 +308,21 @@

lib/Errors.ts

} } +/** + * A 'ForbiddenError' occurs when the user is not allowed to perform the requested action. + * + * @category SDK + * @subcategory Errors + * @extends {HankoError} + */ +class ForbiddenError extends HankoError { + // eslint-disable-next-line require-jsdoc + constructor(cause?: Error) { + super("Forbidden error", "forbidden", cause); + Object.setPrototypeOf(this, ForbiddenError.prototype); + } +} + /** * A 'UserVerificationError' occurs when the user verification requirements * for a WebAuthn ceremony are not met. @@ -393,6 +408,7 @@

lib/Errors.ts

NotFoundError, TooManyRequestsError, UnauthorizedError, + ForbiddenError, UserVerificationError, MaxNumOfEmailAddressesReachedError, EmailAddressAlreadyExistsError, diff --git a/docs/static/jsdoc/hanko-frontend-sdk/lib_Session.ts.html b/docs/static/jsdoc/hanko-frontend-sdk/lib_Session.ts.html index d452e39f9..514d0ea0b 100644 --- a/docs/static/jsdoc/hanko-frontend-sdk/lib_Session.ts.html +++ b/docs/static/jsdoc/hanko-frontend-sdk/lib_Session.ts.html @@ -68,7 +68,7 @@ diff --git a/docs/static/jsdoc/hanko-frontend-sdk/lib_Throttle.ts.html b/docs/static/jsdoc/hanko-frontend-sdk/lib_Throttle.ts.html index 8632af8a4..57451acca 100644 --- a/docs/static/jsdoc/hanko-frontend-sdk/lib_Throttle.ts.html +++ b/docs/static/jsdoc/hanko-frontend-sdk/lib_Throttle.ts.html @@ -68,7 +68,7 @@ diff --git a/docs/static/jsdoc/hanko-frontend-sdk/lib_WebauthnSupport.ts.html b/docs/static/jsdoc/hanko-frontend-sdk/lib_WebauthnSupport.ts.html index ea258b305..0930429b4 100644 --- a/docs/static/jsdoc/hanko-frontend-sdk/lib_WebauthnSupport.ts.html +++ b/docs/static/jsdoc/hanko-frontend-sdk/lib_WebauthnSupport.ts.html @@ -68,7 +68,7 @@ diff --git a/docs/static/jsdoc/hanko-frontend-sdk/lib_client_Client.ts.html b/docs/static/jsdoc/hanko-frontend-sdk/lib_client_Client.ts.html index 4fa87f89a..81ad37dd6 100644 --- a/docs/static/jsdoc/hanko-frontend-sdk/lib_client_Client.ts.html +++ b/docs/static/jsdoc/hanko-frontend-sdk/lib_client_Client.ts.html @@ -68,7 +68,7 @@ diff --git a/docs/static/jsdoc/hanko-frontend-sdk/lib_client_ConfigClient.ts.html b/docs/static/jsdoc/hanko-frontend-sdk/lib_client_ConfigClient.ts.html index 7767f4209..fae4c3fba 100644 --- a/docs/static/jsdoc/hanko-frontend-sdk/lib_client_ConfigClient.ts.html +++ b/docs/static/jsdoc/hanko-frontend-sdk/lib_client_ConfigClient.ts.html @@ -68,7 +68,7 @@ diff --git a/docs/static/jsdoc/hanko-frontend-sdk/lib_client_EmailClient.ts.html b/docs/static/jsdoc/hanko-frontend-sdk/lib_client_EmailClient.ts.html index 86270781c..9ae7910b3 100644 --- a/docs/static/jsdoc/hanko-frontend-sdk/lib_client_EmailClient.ts.html +++ b/docs/static/jsdoc/hanko-frontend-sdk/lib_client_EmailClient.ts.html @@ -68,7 +68,7 @@ diff --git a/docs/static/jsdoc/hanko-frontend-sdk/lib_client_HttpClient.ts.html b/docs/static/jsdoc/hanko-frontend-sdk/lib_client_HttpClient.ts.html index 23dfa255b..da0d676ef 100644 --- a/docs/static/jsdoc/hanko-frontend-sdk/lib_client_HttpClient.ts.html +++ b/docs/static/jsdoc/hanko-frontend-sdk/lib_client_HttpClient.ts.html @@ -68,7 +68,7 @@ @@ -296,14 +296,15 @@

lib/client/HttpClient.ts

} else if (header.startsWith("x-session-lifetime")) { expirationSeconds = parseInt( response.headers.getResponseHeader("X-Session-Lifetime"), - 10 + 10, ); } }); if (jwt) { const secure = !!this.api.match("^https://"); - this.cookie.setAuthCookie(jwt, secure); + const expires = new Date(new Date().getTime() + expirationSeconds * 1000); + this.cookie.setAuthCookie(jwt, { secure, expires }); } this.passcodeState.read().reset(userID).write(); diff --git a/docs/static/jsdoc/hanko-frontend-sdk/lib_client_PasscodeClient.ts.html b/docs/static/jsdoc/hanko-frontend-sdk/lib_client_PasscodeClient.ts.html index c08f27113..44b76811d 100644 --- a/docs/static/jsdoc/hanko-frontend-sdk/lib_client_PasscodeClient.ts.html +++ b/docs/static/jsdoc/hanko-frontend-sdk/lib_client_PasscodeClient.ts.html @@ -68,7 +68,7 @@ diff --git a/docs/static/jsdoc/hanko-frontend-sdk/lib_client_PasswordClient.ts.html b/docs/static/jsdoc/hanko-frontend-sdk/lib_client_PasswordClient.ts.html index 0ede203e5..8bbedf225 100644 --- a/docs/static/jsdoc/hanko-frontend-sdk/lib_client_PasswordClient.ts.html +++ b/docs/static/jsdoc/hanko-frontend-sdk/lib_client_PasswordClient.ts.html @@ -68,7 +68,7 @@ diff --git a/docs/static/jsdoc/hanko-frontend-sdk/lib_client_ThirdPartyClient.ts.html b/docs/static/jsdoc/hanko-frontend-sdk/lib_client_ThirdPartyClient.ts.html index 4c3b9d2f8..606b791a5 100644 --- a/docs/static/jsdoc/hanko-frontend-sdk/lib_client_ThirdPartyClient.ts.html +++ b/docs/static/jsdoc/hanko-frontend-sdk/lib_client_ThirdPartyClient.ts.html @@ -68,7 +68,7 @@ diff --git a/docs/static/jsdoc/hanko-frontend-sdk/lib_client_TokenClient.ts.html b/docs/static/jsdoc/hanko-frontend-sdk/lib_client_TokenClient.ts.html index ca9fbd591..9841992f9 100644 --- a/docs/static/jsdoc/hanko-frontend-sdk/lib_client_TokenClient.ts.html +++ b/docs/static/jsdoc/hanko-frontend-sdk/lib_client_TokenClient.ts.html @@ -68,7 +68,7 @@ diff --git a/docs/static/jsdoc/hanko-frontend-sdk/lib_client_UserClient.ts.html b/docs/static/jsdoc/hanko-frontend-sdk/lib_client_UserClient.ts.html index 6953c798b..0b8b83d06 100644 --- a/docs/static/jsdoc/hanko-frontend-sdk/lib_client_UserClient.ts.html +++ b/docs/static/jsdoc/hanko-frontend-sdk/lib_client_UserClient.ts.html @@ -68,7 +68,7 @@ @@ -91,6 +91,7 @@

lib/client/UserClient.ts

NotFoundError, TechnicalError, UnauthorizedError, + ForbiddenError, } from "../Errors"; import { Client } from "./Client"; @@ -142,6 +143,8 @@

lib/client/UserClient.ts

if (response.status === 409) { throw new ConflictError(); + } if (response.status === 403) { + throw new ForbiddenError(); } else if (!response.ok) { throw new TechnicalError(); } diff --git a/docs/static/jsdoc/hanko-frontend-sdk/lib_client_WebauthnClient.ts.html b/docs/static/jsdoc/hanko-frontend-sdk/lib_client_WebauthnClient.ts.html index 06551168b..f8c4cc74d 100644 --- a/docs/static/jsdoc/hanko-frontend-sdk/lib_client_WebauthnClient.ts.html +++ b/docs/static/jsdoc/hanko-frontend-sdk/lib_client_WebauthnClient.ts.html @@ -68,7 +68,7 @@ diff --git a/docs/static/jsdoc/hanko-frontend-sdk/lib_events_CustomEvents.ts.html b/docs/static/jsdoc/hanko-frontend-sdk/lib_events_CustomEvents.ts.html index 085178d22..9a79d1b18 100644 --- a/docs/static/jsdoc/hanko-frontend-sdk/lib_events_CustomEvents.ts.html +++ b/docs/static/jsdoc/hanko-frontend-sdk/lib_events_CustomEvents.ts.html @@ -68,7 +68,7 @@ diff --git a/docs/static/jsdoc/hanko-frontend-sdk/lib_events_Dispatcher.ts.html b/docs/static/jsdoc/hanko-frontend-sdk/lib_events_Dispatcher.ts.html index cb6ee03bb..3f01503cf 100644 --- a/docs/static/jsdoc/hanko-frontend-sdk/lib_events_Dispatcher.ts.html +++ b/docs/static/jsdoc/hanko-frontend-sdk/lib_events_Dispatcher.ts.html @@ -68,7 +68,7 @@ diff --git a/docs/static/jsdoc/hanko-frontend-sdk/lib_events_Listener.ts.html b/docs/static/jsdoc/hanko-frontend-sdk/lib_events_Listener.ts.html index 640d4493f..2ea7cf815 100644 --- a/docs/static/jsdoc/hanko-frontend-sdk/lib_events_Listener.ts.html +++ b/docs/static/jsdoc/hanko-frontend-sdk/lib_events_Listener.ts.html @@ -68,7 +68,7 @@ diff --git a/docs/static/jsdoc/hanko-frontend-sdk/lib_events_Relay.ts.html b/docs/static/jsdoc/hanko-frontend-sdk/lib_events_Relay.ts.html index a4e9197de..353393cc6 100644 --- a/docs/static/jsdoc/hanko-frontend-sdk/lib_events_Relay.ts.html +++ b/docs/static/jsdoc/hanko-frontend-sdk/lib_events_Relay.ts.html @@ -68,7 +68,7 @@ diff --git a/docs/static/jsdoc/hanko-frontend-sdk/lib_events_Scheduler.ts.html b/docs/static/jsdoc/hanko-frontend-sdk/lib_events_Scheduler.ts.html index 4776a2087..29ca36d24 100644 --- a/docs/static/jsdoc/hanko-frontend-sdk/lib_events_Scheduler.ts.html +++ b/docs/static/jsdoc/hanko-frontend-sdk/lib_events_Scheduler.ts.html @@ -68,7 +68,7 @@ diff --git a/docs/static/jsdoc/hanko-frontend-sdk/lib_state_State.ts.html b/docs/static/jsdoc/hanko-frontend-sdk/lib_state_State.ts.html index 3532dc316..b48a86140 100644 --- a/docs/static/jsdoc/hanko-frontend-sdk/lib_state_State.ts.html +++ b/docs/static/jsdoc/hanko-frontend-sdk/lib_state_State.ts.html @@ -68,7 +68,7 @@ diff --git a/docs/static/jsdoc/hanko-frontend-sdk/lib_state_session_SessionState.ts.html b/docs/static/jsdoc/hanko-frontend-sdk/lib_state_session_SessionState.ts.html index ac2516183..87f0507ea 100644 --- a/docs/static/jsdoc/hanko-frontend-sdk/lib_state_session_SessionState.ts.html +++ b/docs/static/jsdoc/hanko-frontend-sdk/lib_state_session_SessionState.ts.html @@ -68,7 +68,7 @@ diff --git a/docs/static/jsdoc/hanko-frontend-sdk/lib_state_users_PasscodeState.ts.html b/docs/static/jsdoc/hanko-frontend-sdk/lib_state_users_PasscodeState.ts.html index 4caa14ee6..34676fdc1 100644 --- a/docs/static/jsdoc/hanko-frontend-sdk/lib_state_users_PasscodeState.ts.html +++ b/docs/static/jsdoc/hanko-frontend-sdk/lib_state_users_PasscodeState.ts.html @@ -68,7 +68,7 @@ diff --git a/docs/static/jsdoc/hanko-frontend-sdk/lib_state_users_PasswordState.ts.html b/docs/static/jsdoc/hanko-frontend-sdk/lib_state_users_PasswordState.ts.html index 3048e2b20..99d5258bf 100644 --- a/docs/static/jsdoc/hanko-frontend-sdk/lib_state_users_PasswordState.ts.html +++ b/docs/static/jsdoc/hanko-frontend-sdk/lib_state_users_PasswordState.ts.html @@ -68,7 +68,7 @@ diff --git a/docs/static/jsdoc/hanko-frontend-sdk/lib_state_users_UserState.ts.html b/docs/static/jsdoc/hanko-frontend-sdk/lib_state_users_UserState.ts.html index be1050b96..b6c987fb6 100644 --- a/docs/static/jsdoc/hanko-frontend-sdk/lib_state_users_UserState.ts.html +++ b/docs/static/jsdoc/hanko-frontend-sdk/lib_state_users_UserState.ts.html @@ -68,7 +68,7 @@ diff --git a/docs/static/jsdoc/hanko-frontend-sdk/lib_state_users_WebauthnState.ts.html b/docs/static/jsdoc/hanko-frontend-sdk/lib_state_users_WebauthnState.ts.html index 39c4f11c3..6c85102d5 100644 --- a/docs/static/jsdoc/hanko-frontend-sdk/lib_state_users_WebauthnState.ts.html +++ b/docs/static/jsdoc/hanko-frontend-sdk/lib_state_users_WebauthnState.ts.html @@ -68,7 +68,7 @@ diff --git a/frontend/frontend-sdk/src/lib/Cookie.ts b/frontend/frontend-sdk/src/lib/Cookie.ts index 518d541e7..ce7cb5165 100644 --- a/frontend/frontend-sdk/src/lib/Cookie.ts +++ b/frontend/frontend-sdk/src/lib/Cookie.ts @@ -11,6 +11,19 @@ interface CookieOptions { cookieName: string; } +/** + * Options for setting the auth cookie. + * + * @category SDK + * @subcategory Internal + * @property {boolean} secure - Indicates if the Secure attribute of the cookie should be set. + * @property {number | Date | undefined} expires - The expiration of the cookie. + */ +interface SetAuthCookieOptions { + secure?: boolean; + expires?: number | Date | undefined; +} + /** * A class to manage cookies. * @@ -39,10 +52,13 @@ export class Cookie { * Stores the authentication token to the cookie. * * @param {string} token - The authentication token to be stored. - * @param {boolean=} secure - Indicates a secure cookie should be set. Default is `true`. + * @param options */ - setAuthCookie(token: string, secure = true) { - JSCookie.set(this.authCookieName, token, { secure }); + setAuthCookie( + token: string, + options: SetAuthCookieOptions = { secure: true }, + ) { + JSCookie.set(this.authCookieName, token, options); } /** diff --git a/frontend/frontend-sdk/src/lib/client/HttpClient.ts b/frontend/frontend-sdk/src/lib/client/HttpClient.ts index b6aa3f425..dadf448bc 100644 --- a/frontend/frontend-sdk/src/lib/client/HttpClient.ts +++ b/frontend/frontend-sdk/src/lib/client/HttpClient.ts @@ -209,14 +209,15 @@ class HttpClient { } else if (header.startsWith("x-session-lifetime")) { expirationSeconds = parseInt( response.headers.getResponseHeader("X-Session-Lifetime"), - 10 + 10, ); } }); if (jwt) { const secure = !!this.api.match("^https://"); - this.cookie.setAuthCookie(jwt, secure); + const expires = new Date(new Date().getTime() + expirationSeconds * 1000); + this.cookie.setAuthCookie(jwt, { secure, expires }); } this.passcodeState.read().reset(userID).write(); diff --git a/frontend/frontend-sdk/tests/lib/Cookie.spec.ts b/frontend/frontend-sdk/tests/lib/Cookie.spec.ts index 4c48da760..78a645389 100644 --- a/frontend/frontend-sdk/tests/lib/Cookie.spec.ts +++ b/frontend/frontend-sdk/tests/lib/Cookie.spec.ts @@ -1,5 +1,6 @@ import JSCookie from "js-cookie"; import { Cookie } from "../../src/lib/Cookie"; +import { fakeTimerNow } from "../setup"; describe("Cookie()", () => { let cookie: Cookie; @@ -11,7 +12,7 @@ describe("Cookie()", () => { describe("cookie.setAuthCookie()", () => { it("should set a new cookie", async () => { jest.spyOn(JSCookie, "set"); - cookie.setAuthCookie("test-token", false); + cookie.setAuthCookie("test-token", { secure: false }); expect(JSCookie.set).toHaveBeenCalledWith("hanko", "test-token", { secure: false, }); @@ -25,6 +26,16 @@ describe("Cookie()", () => { secure: true, }); }); + + it("should set a new cookie with expiration", async () => { + jest.spyOn(JSCookie, "set"); + const expires = new Date(fakeTimerNow + 60); + cookie.setAuthCookie("test-token", { secure: true, expires }); + expect(JSCookie.set).toHaveBeenCalledWith("hanko", "test-token", { + secure: true, + expires, + }); + }); }); describe("cookie.getAuthCookie()", () => { diff --git a/frontend/frontend-sdk/tests/lib/client/HttpClient.spec.ts b/frontend/frontend-sdk/tests/lib/client/HttpClient.spec.ts index 734c038a3..4f73ae472 100644 --- a/frontend/frontend-sdk/tests/lib/client/HttpClient.spec.ts +++ b/frontend/frontend-sdk/tests/lib/client/HttpClient.spec.ts @@ -4,6 +4,7 @@ import { HttpClient, } from "../../../src/lib/client/HttpClient"; import { RequestTimeoutError, TechnicalError } from "../../../src"; +import { fakeTimerNow } from "../../setup"; const jwt = "test-token"; let httpClient: HttpClient; @@ -224,7 +225,10 @@ describe("httpClient.processResponseHeadersOnLogin()", () => { ); expect(client.sessionState.setUserID).toHaveBeenCalledWith(userID); - expect(client.cookie.setAuthCookie).toHaveBeenCalledWith(jwt, false); + expect(client.cookie.setAuthCookie).toHaveBeenCalledWith(jwt, { + secure: false, + expires: new Date(fakeTimerNow + expirationSeconds * 1000), + }); expect(client.cookie.setAuthCookie).toBeCalledTimes(1); }); @@ -240,7 +244,10 @@ describe("httpClient.processResponseHeadersOnLogin()", () => { jest.spyOn(client.cookie, "setAuthCookie"); client.processResponseHeadersOnLogin(userID, response); - expect(client.cookie.setAuthCookie).toHaveBeenCalledWith(jwt, true); + expect(client.cookie.setAuthCookie).toHaveBeenCalledWith(jwt, { + secure: true, + expires: new Date(fakeTimerNow + expirationSeconds * 1000), + }); expect(client.cookie.setAuthCookie).toBeCalledTimes(1); }); }); diff --git a/frontend/frontend-sdk/tests/setup.ts b/frontend/frontend-sdk/tests/setup.ts index 3fdc190ea..5cea5c7f3 100644 --- a/frontend/frontend-sdk/tests/setup.ts +++ b/frontend/frontend-sdk/tests/setup.ts @@ -82,12 +82,15 @@ export const fakeXMLHttpRequest = (function () { })); })(); + Object.defineProperty(global, "XMLHttpRequest", { value: fakeXMLHttpRequest, configurable: true, writable: true, }); +export const fakeTimerNow = 1664379699000; + jest.useFakeTimers({ - now: 1664379699000, + now: fakeTimerNow, });