Skip to main content

createAccessToken

talawa-apiDocs


talawa-api / utilities/auth / createAccessToken

Function: createAccessToken()

> createAccessToken(user, appUserProfile): string

Creates an access token (JWT) for a user that expires in 40 minutes. The token contains user data and is signed with the access token secret.

Parameters

user: InterfaceUser

User data

appUserProfile: InterfaceAppUserProfile

Application user profile data

Returns

string

JSON Web Token string payload

Defined in

src/utilities/auth.ts:25