Class

PasscodeState

PasscodeState()

A class that manages passcodes via local storage.
Constructor

# new PasscodeState()

View Source lib/state/users/PasscodeState.ts, line 11

Extends

Members

Methods

# getActiveID(userID) → {string}

Gets the UUID of the active passcode.
Parameters:
Name Type Description
userID string The UUID of the user.

View Source lib/state/users/PasscodeState.ts, line 167

string

# getEmailID(userID) → {string}

Gets the UUID of the email address.
Parameters:
Name Type Description
userID string The UUID of the user.

View Source lib/state/users/PasscodeState.ts, line 184

string

# getResendAfter(userID) → {number}

Gets the number of seconds until when the next passcode can be sent.
Parameters:
Name Type Description
userID string The UUID of the user.

View Source lib/state/users/PasscodeState.ts, line 226

number

# getTTL(userID) → {number}

Gets the TTL in seconds. When the seconds expire, the code is invalid.
Parameters:
Name Type Description
userID string The UUID of the user.

View Source lib/state/users/PasscodeState.ts, line 209

number

# getUserState(userID) → {LocalStorageUser}

Gets the state of the specified user.
Parameters:
Name Type Description
userID string The UUID of the user.
Overrides:

View Source lib/state/users/UserState.ts, line 25

# read() → {PasscodeState}

Reads the current state.
Overrides:

View Source lib/state/users/PasscodeState.ts, line 159

# reset(userID) → {PasscodeState}

Removes the active passcode.
Parameters:
Name Type Description
userID string The UUID of the user.

View Source lib/state/users/PasscodeState.ts, line 201

# setActiveID(userID, passcodeID) → {PasscodeState}

Sets the UUID of the active passcode.
Parameters:
Name Type Description
userID string The UUID of the user.
passcodeID string The UUID of the passcode to be set as active.

View Source lib/state/users/PasscodeState.ts, line 176

# setEmailID(userID, emailID) → {PasscodeState}

Sets the UUID of the email address.
Parameters:
Name Type Description
userID string The UUID of the user.
emailID string The UUID of the email address.

View Source lib/state/users/PasscodeState.ts, line 193

# setResendAfter(userID, seconds) → {PasscodeState}

Sets the number of seconds until a new passcode can be sent.
Parameters:
Name Type Description
userID string The UUID of the user.
seconds number Number of seconds the passcode is valid for.

View Source lib/state/users/PasscodeState.ts, line 235

# setTTL(userID, seconds) → {PasscodeState}

Sets the passcode's TTL and stores it to the local storage.
Parameters:
Name Type Description
userID string The UUID of the user.
seconds string Number of seconds the passcode is valid for.

View Source lib/state/users/PasscodeState.ts, line 218

# write() → {State}

Encodes and writes the data to the local storage.
Inherited From:

View Source lib/state/State.ts, line 49

State