Methods

async static

changePassword(params) → Promise containing AuthApiResponse

changes the password of a user

Parameters

Name Type Optional Description

params

Object

 

Values in params have the following properties:

Name Type Optional Description

oldPassword

string

 

newPassword

string

 

Returns

Promise containing AuthApiResponse 

async static

confirmSignUp(params) → Promise containing AuthApiResponse

confirms the sign up of a user

Parameters

Name Type Optional Description

params

Object

 

Values in params have the following properties:

Name Type Optional Description

username

string

 

code

string

 

Returns

Promise containing AuthApiResponse 

async static

forgotPassword(params) → Promise containing AuthApiResponse

initiates a password reset

Parameters

Name Type Optional Description

params

Object

 

Values in params have the following properties:

Name Type Optional Description

usernameOrEmail

string

 

Returns

Promise containing AuthApiResponse 

async static

forgotPasswordSubmit(params) → Promise containing AuthApiResponse

resets a user's password

Parameters

Name Type Optional Description

params

Object

 

Values in params have the following properties:

Name Type Optional Description

usernameOrEmail

string

 

code

string

 

newPassword

string

 

Returns

Promise containing AuthApiResponse 

async static

getCurrentSesssion() → Promise containing AuthApiResponse

returns an existing cognito session

Returns

Promise containing AuthApiResponse 

async static

resendConfirmationCode(params) → Promise containing AuthApiResponse

re-requests the sign up code to be delivered to the users email

Parameters

Name Type Optional Description

params

Object

 

Values in params have the following properties:

Name Type Optional Description

username

string

 

the username for the confirmation code

Returns

Promise containing AuthApiResponse 

async static

signIn(usernameOrEmail, password) → Promise containing AuthApiResponse

signs in a user

Parameters

Name Type Optional Description

usernameOrEmail

string

 

password

string

 

Returns

Promise containing AuthApiResponse 

async static

signOut([params]) → undefined

signs out a user by invalidating their access token; when the global flag is set, any access tokens on other machines are not refreshed anymore, i.e. they expire within one hour

Parameters

Name Type Optional Description

params

Object

Yes

Values in params have the following properties:

Name Type Optional Description

global

boolean

Yes

Defaults to false.

Returns

undefined 

async static

signUp(params) → Promise containing AuthApiResponse

signs up a user for the OSPIN web app

Parameters

Name Type Optional Description

params

Object

 

Values in params have the following properties:

Name Type Optional Description

username

string

 

password

string

 

attributes

Object

Yes

attributes.email

string

Yes

attributes.phoneNumber

string

Yes

Returns

Promise containing AuthApiResponse