Authenticate user (AppGyver Auth)
- 18 May 2022
- 1 Minute to read
-
DarkLight
-
PDF
Authenticate user (AppGyver Auth)
- Updated on 18 May 2022
- 1 Minute to read
-
DarkLight
-
PDF
Authenticate an user against your app's AppGyver Hosted Auth or AppGyver Cloud Auth backend.
If the authentication is succesful, the local user session is set and the first output is triggered.
If the authentication fails, the second output is triggered.
To use this flow, your app must have its authentication type set as AppGyver Hosted Auth or AppGyver Cloud Auth.
Input arguments
Label | Key | Type | Required? | Default | Description |
---|---|---|---|---|---|
Credentials | credentials |
Object | Yes | – | Credentials object to send to the backend. For AppGyver Hosted Auth, this should always contain the username and password keys. For Cloud Auth, the credentials object can contain whatever is required by your integration. |
Output arguments
Number of outputs: 2
Label | Key | Type | Description |
---|---|---|---|
Current user | currentUser
|
Object | Object containing the current user information. |
|
currentUser.id
|
Number | Unique user ID for the logged-in user. |
|
currentUser.username
|
String | Username for the logged-in user, typically an email address |
|
currentUser.metadata
|
Object | User metadata. Since no schema is enforced by the backend, it is given here as a schemaless object. |
|
currentUser.groups
|
Array | Groups the user belongs to. |
|
currentUser.accessToken
|
String | Access token used to access AppGyver-hosted cloud resources, such as databases or integrations. |
Events
No events.
Errors
Label | Code | Description |
---|---|---|
Authentication failed | authFailed |
Thrown if the authenticating the user failed. |
Was this article helpful?