AuthShield v0.0.4 AuthShield.Credentials.PIN View Source
A personal identification number (PIN), or sometimes redundantly a PIN number, is a numeric or alpha-numeric password used in the process of authenticating a user accessing a system.
It is usually used in ATM oe POS transactions to authenticate identities and secure access control.
This module implements an interface to deal with database transactions as inserts, updates, deletes, etc.
Link to this section Summary
Functions
Checks if the given PIN code matches with the credential pin_hash
Deletes a AuthShield.Credentials.Schemas.PIN register.
Deletes a AuthShield.Credentials.Schemas.PIN register.
Gets a AuthShield.Credentials.Schemas.PIN register by its filters.
Gets a AuthShield.Credentials.Schemas.PIN register by its filters.
Creates a new AuthShield.Credentials.Schemas.PIN register.
Creates a new AuthShield.Credentials.Schemas.PIN register.
Returns a list of AuthShield.Credentials.Schemas.PIN by its filters
Link to this section Functions
check_pin?(pin, code)
View Sourcecheck_pin?( pin :: AuthShield.Credentials.Schemas.PIN.t(), pin_code :: String.t() ) :: boolean()
Checks if the given PIN code matches with the credential pin_hash
It calls the Argon2 to verify and returns true if the PIN
matches and false if the PIN doesn't match.
Exemples:
AuthShield.Credentials.PIN.check_pin?(pin, "332456")
Deletes a AuthShield.Credentials.Schemas.PIN register.
Exemples:
AuthShield.Credentials.PIN.delete(pin)
Deletes a AuthShield.Credentials.Schemas.PIN register.
Similar to delete/1 but returns the struct or raises if the changeset is invalid.
Gets a AuthShield.Credentials.Schemas.PIN register by its filters.
Exemples:
AuthShield.Credentials.PIN.get_by(user_id: "ecb4c67d-6380-4984-ae04-1563e885d59e")
Gets a AuthShield.Credentials.Schemas.PIN register by its filters.
Similar to get_by/1 but returns the struct or raises if the changeset is invalid.
Creates a new AuthShield.Credentials.Schemas.PIN register.
Exemples:
AuthShield.Credentials.PIN.insert(%{
user_id: "ecb4c67d-6380-4984-ae04-1563e885d59e",
pin: "332456"
})
Creates a new AuthShield.Credentials.Schemas.PIN register.
Similar to insert/1 but returns the struct or raises if the changeset is invalid.
Returns a list of AuthShield.Credentials.Schemas.PIN by its filters
Exemples:
# Getting the all list
AuthShield.Credentials.PIN.list()
# Filtering the list by field
AuthShield.Credentials.PIN.list(user_id: "ecb4c67d-6380-4984-ae04-1563e885d59e")