Skip to content

Commit

Permalink
fix: remove unused typings in jsdocs (#63)
Browse files Browse the repository at this point in the history
  • Loading branch information
YohanToledo authored Aug 23, 2023
1 parent 7b86487 commit fe7ee2a
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
6 changes: 3 additions & 3 deletions src/authTokenInterceptor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ let currentlyRequestingPromise: Promise<Token | undefined> | undefined = undefin
/**
* Gets the unix timestamp from an access token
*
* @param {string} token - Access token
* @returns {string} Unix timestamp
* @param {Token} token - Access token
* @returns Unix timestamp
*/
const getTimestampFromToken = (token: Token): number | undefined => {
const decoded = jwtDecode<JwtPayload>(token)
Expand Down Expand Up @@ -106,7 +106,7 @@ const refreshToken = async (requestRefresh: TokenRefreshRequest): Promise<Token>

/**
* Gets the current access token, exchanges it with a new one if it's expired and then returns the token.
* @param {requestRefresh} requestRefresh - Function that is used to get a new access token
* @param {TokenRefreshRequest} requestRefresh - Function that is used to get a new access token
* @returns {string} Access token
*/
export const refreshTokenIfNeeded = async (
Expand Down
10 changes: 5 additions & 5 deletions src/tokensUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import { IAuthTokens } from './IAuthTokens'

/**
* Returns the refresh and access tokens
* @returns {IAuthTokens} Object containing refresh and access tokens
* @returns Object containing refresh and access tokens
*/
const getAuthTokens = async (): Promise<IAuthTokens | undefined> => {
const rawTokens = await StorageProxy.Storage?.get(STORAGE_KEY)
Expand All @@ -27,12 +27,12 @@ const getAuthTokens = async (): Promise<IAuthTokens | undefined> => {

/**
* Sets the access token
* @param {string} token - Access token
* @param {Token} token - Access token
*/
export const setAccessToken = async (token: Token): Promise<void> => {
const tokens = await getAuthTokens()
if (!tokens) {
throw new Error('Unable to update access token since there are not tokens currently stored')
throw new Error('Unable to update access token since there are no tokens currently stored')
}

tokens.accessToken = token
Expand All @@ -41,7 +41,7 @@ export const setAccessToken = async (token: Token): Promise<void> => {

/**
* Returns the stored refresh token
* @returns {string} Refresh token
* @returns Refresh token
*/
export const getRefreshToken = async (): Promise<Token | undefined> => {
const tokens = await getAuthTokens()
Expand All @@ -50,7 +50,7 @@ export const getRefreshToken = async (): Promise<Token | undefined> => {

/**
* Returns the stored access token
* @returns {string} Access token
* @returns Access token
*/
export const getAccessToken = async (): Promise<Token | undefined> => {
const tokens = await getAuthTokens()
Expand Down

0 comments on commit fe7ee2a

Please sign in to comment.