diff --git a/docs/api/$auth.md b/docs/api/$auth.md index 08f7f11..27a83bb 100644 --- a/docs/api/$auth.md +++ b/docs/api/$auth.md @@ -138,12 +138,10 @@ By default, this instance has the following features: - Automatically refresh the access token if it has expired (when the request returns a 401 status code), then retry the request. - Debug log if the [debug option](/api/options.html#debug) is set to `true`. -## Methods - ### `accessToken` ```ts -function accessToken(): string | null | undefined; +accessToken: string | null; ``` Contains the value of the access token, returns `null` if not logged in or the token has expired. @@ -151,7 +149,7 @@ Contains the value of the access token, returns `null` if not logged in or the t ### `refreshToken` ```ts -function refreshToken(): string | null | undefined; +refreshToken: string | null; ``` Contains the value of the refresh token, returns `null` if not logged in or the token has expired. @@ -159,7 +157,7 @@ Contains the value of the refresh token, returns `null` if not logged in or the ### `hasTokens` ```ts -function hasTokens(): boolean; +hasTokens: boolean; ``` Has a value of `true` when there are tokens in the cookie and the tokens are still valid (either access token or refresh token). @@ -167,7 +165,7 @@ Has a value of `true` when there are tokens in the cookie and the tokens are sti ### `isSessionExpired` ```ts -function isSessionExpired(): boolean; +isSessionExpired: boolean; ``` Has a value of `true` when the user is **logged in but the access token has expired** while **the refresh token is still valid**. @@ -175,11 +173,13 @@ Has a value of `true` when the user is **logged in but the access token has expi ### `isSessionEnd` ```ts -function isSessionEnd(): boolean; +isSessionEnd: boolean; ``` Has a value of `true` when both the access token and refresh token have expired. +## Methods + ### `login` ```ts diff --git a/docs/vi/api/$auth.md b/docs/vi/api/$auth.md index 31a842f..a766da8 100644 --- a/docs/vi/api/$auth.md +++ b/docs/vi/api/$auth.md @@ -137,13 +137,10 @@ Instance này mặc định được thiết lập sẵn một số cài đặt - Tự động refresh token khi request trả về lỗi `401 Unauthorized`, sau đó retry lại request. - Debug log nếu set [option debug](/vi/api/options.html#debug) là `true`. -## Methods - - ### `accessToken` ```ts -function accessToken(): string | null | undefined; +accessToken: string | null; ``` Chứa giá trị của access token, trả về `null` nếu chưa đăng nhập hoặc token đã hết hạn. @@ -151,7 +148,7 @@ Chứa giá trị của access token, trả về `null` nếu chưa đăng nhậ ### `refreshToken` ```ts -function refreshToken(): string | null | undefined; +refreshToken: string | null; ``` Chứa giá trị của refesh token, trả về `null` nếu chưa đăng nhập hoặc token đã hết hạn. @@ -159,7 +156,7 @@ Chứa giá trị của refesh token, trả về `null` nếu chưa đăng nhậ ### `hasTokens` ```ts -function hasTokens(): boolean; +hasTokens: boolean; ``` Có giá trị `true` khi có token trong cookie và token còn hạn sử dụng (bất kể access token hoặc refresh token). @@ -167,7 +164,7 @@ Có giá trị `true` khi có token trong cookie và token còn hạn sử dụn ### `isSessionExpired` ```ts -function isSessionExpired(): boolean; +isSessionExpired: boolean; ``` Có giá trị `true` khi user đã log in nhưng **access token đã hết hạn** nhưng **refresh token vẫn còn hạn sử dụng**. @@ -175,11 +172,13 @@ Có giá trị `true` khi user đã log in nhưng **access token đã hết hạ ### `isSessionEnd` ```ts -function isSessionEnd(): boolean; +isSessionEnd: boolean; ``` Có giá trị `true` khi cả access token và refresh token đều đã hết hạn. +## Methods + ### `login` ```ts