This repository has been archived by the owner on Sep 21, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 4
User Authentication
Ahmed Castro edited this page Sep 7, 2018
·
9 revisions
User Authentication methods make possible handling user sessions. For more information about the methods wrapped please visit User Authentication (C compatible) documentation on the SDK wiki.
emailRequest(email:String, callback:(response_code:Int)):Void
Requests a 5-digit security code to be sent via email. emailExchange should be called after to complete the authentication process.
Name | Type | Description |
---|---|---|
String |
User's email. | |
callback | (response_code:Int) |
Function called once the process finished. |
Name | Type | Description |
---|---|---|
response_code | Int |
Response Code returned from the mod.io API. |
emailExchange(security_code:String, callback:(response_code:Int)):Void
Exchanges the 5-digit code for an authentication token. The token is handled internally by the SDK.
Name | Type | Description |
---|---|---|
security_code | String |
5-digit code sent to users via email when emailRequest was called. |
callback | (response_code:Int) |
Function called once the process finished. |
Name | Type | Description |
---|---|---|
response_code | Int |
Response Code returned from the mod.io API. |
isLoggedIn():Bool
Returns true if the user is logged in, otherwise returns false.
logout():Bool
Logs out the user from mod.io.