Skip to content
This repository has been archived by the owner on Sep 21, 2022. It is now read-only.

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

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.

Function parameters

Name Type Description
email String User's email.
callback (response_code:Int) Function called once the process finished.

Callback parameters

Name Type Description
response_code Int Response Code returned from the mod.io API.

emailExchange

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.

Function parameters

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.

Callback parameters

Name Type Description
response_code Int Response Code returned from the mod.io API.

isLoggedIn

isLoggedIn():Bool

Returns true if the user is logged in, otherwise returns false.

logout

logout():Bool

Logs out the user from mod.io.

Clone this wiki locally