new OAuth2Client(options)
Construct an OAuth2Client instance, which handles OAuth2Account management.
Parameters:
Name | Type | Description | ||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
options |
Object |
Properties
|
Methods
createAccount(options) → {OAuth2Account|Error}
Factory method that will create a OAuth2Account.
Parameters:
Name | Type | Description | ||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
options |
Object |
Properties
|
Returns:
- Type
- OAuth2Account | Error
deleteAccount(account)
Method that will delete a provided OAuth2Account. It calls the instance's destroy method and removes it from the accounts list.
Parameters:
Name | Type | Description |
---|---|---|
account |
OAuth2Account | OAuth2Account to be deleted |
getAccount(id) → {OAuth2Account|Error}
Method that will return OAuth2Account if found by matching provided id.
Parameters:
Name | Type | Description |
---|---|---|
id |
string |
Returns:
- Type
- OAuth2Account | Error
getStoreValues() → {Object}
Returns important values that should be stored persistently.
Returns:
- Type
- Object
registeredAccounts() → {Array}
Method that returns the accounts list of this client.
Returns:
- Type
- Array