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

User Authentication

turupawn edited this page Feb 6, 2019 · 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:Dynamic)):Void

Requests a 5-digit security code to be sent via email. emailExchange should be called after to complete the authentication process.

SDK documentation: modioEmailRequest

API documentation: Authentication

Function parameters

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

Callback parameters

Name Type Description
response Dynamic Response object

emailExchange

emailExchange(security_code:String, callback:(response:Dynamic)):Void

Exchanges the 5-digit code for an authentication token. The token is handled internally by the SDK.

SDK documentation: modioEmailExchange

API documentation: Authentication

Function parameters

Name Type Description
security_code String 5-digit code sent to users via email when emailRequest was called.
callback (response:Dynamic) Function called once the process finished.

Callback parameters

Name Type Description
response Dynamic Response object returned from the mod.io API.

isLoggedIn

isLoggedIn():Bool

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

SDK documentation: modioIsLoggedIn

API documentation: Authentication

logout

logout():Bool

Logs out the user from mod.io.

SDK documentation: modioLogout

API documentation: Authentication

Clone this wiki locally