Reference Source
public class | source

LoginModel

Extends:

* → LoginModel

Class for the login model to be used by the LoginPresenter and SignupPresenter

Constructor Summary

Public Constructor
public

Creates an instance of LoginModelCreates an observerlist.

Member Summary

Private Members
private

_data: {"data": *}

Method Summary

Public Methods
public

get(): Object

Returns the data from the model.

public

Trigger the on reads for models by adding a new item to the Bike list

public

async update(newData: Object)

async method for presenters to know if the username and password is existed in the database

public

updateF(onError: Function)

Request sign-in with Facebook.

public

updateT(onError: Function)

Request sign-in with Twitter.

Private Methods
private

Function to call on a successful authentication of the user signing in to the database.

private

Check if a profile image exists.

Public Constructors

public constructor() source

Creates an instance of LoginModelCreates an observerlist.

Private Members

private _data: {"data": *} source

Public Methods

public get(): Object source

Returns the data from the model.

Return:

Object

A deconstructed copy of the data object

public triggerOnReads() source

Trigger the on reads for models by adding a new item to the Bike list

public async update(newData: Object) source

async method for presenters to know if the username and password is existed in the database

Params:

NameTypeAttributeDescription
newData Object

data including username and password.

public updateF(onError: Function) source

Request sign-in with Facebook.

Params:

NameTypeAttributeDescription
onError Function

Callback function to call if there is an error

public updateT(onError: Function) source

Request sign-in with Twitter.

Params:

NameTypeAttributeDescription
onError Function

Callback function to call if there is an error

Private Methods

private _authenticationSuccess() source

Function to call on a successful authentication of the user signing in to the database.

private _checkProfileImageExists(userID: string) source

Check if a profile image exists.

Params:

NameTypeAttributeDescription
userID string

The current user's id