Auth

Auth

# new Auth()

Methods

# (static) authenticate(params) → {Promise.<AuthResponse>}

Authenticate with GetSocial.
Parameters:
Name Type Description
params Object Authentication parameters.
Properties
Name Type Attributes Default Description
identity_type string facebook or Custom identity type, e.g email or myapp.
token string A unique token for this user. You will need to provide the same token to be able to reauthenticate as this user. If identity_type is facebook, use a valid Facebook access token instead.
new_user boolean <optional>
false Whether this user is new to your app or not.
Returns:
A Promise for the authenticated user and referral information.
Type
Promise.<AuthResponse>

# (static) logout()

Logs out the current user.

Type Definitions

# AuthResponse

Type:
  • Object
Properties
Name Type Description
user User Authenticated user
referral Object Referral information, if any
Properties
Name Type Description
data Object Referral data, see reference.
original_data Object Contains original values of keys in data if they were overriden.
referrer User The user who referred the current user, if any.

# User

Type:
  • Object
Properties
Name Type Description
user.id string User ID
user.display_name string Username
user.avatar_url string URL to user's picture
user.auth_identities Object Custom identity key/value pairs, e.g "email":"hello@example.com"
user.public_properties Object.<string, string> User's Public Properties key/value pairs, e.g "level":"1"
user.private_properties Object.<string, string> User's Private Properties key/value pairs, e.g "paying_user":"true"