SmsUp (sms_up v0.1.0) View Source

Documentation for SmsUp.

Link to this section Summary

Functions

Generate a pin code for the given id and store it in a mnesia database. Returns the generated pin code.

Validate a pin code along with the user id and tells if the provided pin is correct or not. Returns a tupple containing true or false regarding the result.

Link to this section Functions

Specs

store(any()) :: {:error, binary()} | {:ok, binary()}

Generate a pin code for the given id and store it in a mnesia database. Returns the generated pin code.

Examples

iex> SmsUp.store("user@email.ch")
{:ok, "123456"}

Specs

validate(any(), binary()) :: {:ok, boolean()}

Validate a pin code along with the user id and tells if the provided pin is correct or not. Returns a tupple containing true or false regarding the result.

Examples

iex> SmsUp.validate("user@email.ch", "Good Pin")
{:ok, true}

iex> SmsUp.validate("user@email.ch", "Wrong Pin")
{:ok, false}