Skip to main content

talawa-api / Exports / utilities/auth

Module: utilities/auth

Table of contents

Interfaces

Functions

Functions

createAccessToken

createAccessToken(user): string

This function creates a json web token which expires in 15 minutes. It signs the given payload(user data) into a JSON Web Token string payload.

Parameters

NameTypeDescription
userInterfaceUserUser data

Returns

string

JSON Web Token string payload

Defined in

src/utilities/auth.ts:19


createRefreshToken

createRefreshToken(user): string

Parameters

NameType
userInterfaceUser

Returns

string

Defined in

src/utilities/auth.ts:35


revokeRefreshToken

revokeRefreshToken(userId): Promise<void>

Parameters

NameType
userIdstring

Returns

Promise<void>

Defined in

src/utilities/auth.ts:51