authex v0.2.0 Authex.Banlist behaviour View Source
Link to this section Summary
Functions
Takes an Authex.Token
struct or binary or integer sub and deletes it from the banlist
using the provided module
Takes an Authex.Token
struct or binary or integer sub and checks whether it has been
banned using the provided module
Takes an Authex.Token
struct or binary or integer sub and sets it as being banned
using the provided module
Callbacks
Removes the provided binary or integer sub from the banlist
Checks whether the banlist contains the provided binary or integer sub
Puts the provided binary sub into the banlist
Link to this section Types
Link to this section Functions
del(banlist :: Authex.Banlist.t(), token_or_sub()) :: :ok | :error
Takes an Authex.Token
struct or binary or integer sub and deletes it from the banlist
using the provided module.
Returns :ok
if the operation was successful.
Returns :error
if an error occured.
Parameters
- banlist: A banlist module.
- token_or_sub: An
Authex.Token
struct or binary or integer sub.
get(banlist :: Authex.Banlist.t(), token_or_sub()) :: boolean() | :error
Takes an Authex.Token
struct or binary or integer sub and checks whether it has been
banned using the provided module.
Returns false
if the sub is not banned.
Returns true
if the sub is banned.
Otherwise, returns :error
.
Parameters
- banlist: A banlist module.
- token_or_sub: An
Authex.Token
struct or binary or integer sub.
set(banlist :: Authex.Banlist.t(), token_or_sub()) :: :ok | :error
Takes an Authex.Token
struct or binary or integer sub and sets it as being banned
using the provided module.
Returns :ok
if the operation was successful.
Returns :error
if an error occured.
Parameters
- banlist: A banlist module.
- token_or_sub: An
Authex.Token
struct or binary or integer sub.
Link to this section Callbacks
Removes the provided binary or integer sub from the banlist.
Returning :ok
signals the operation was successful.
Returning :error
signals an error occured.
Parameters
- sub: A binary or integer sub.
Checks whether the banlist contains the provided binary or integer sub.
Returning true
signals that the sub is banned.
Returning false
signals that the sub is not banned.
Returning :error
signals an error occured.
Parameters
- sub: A binary or integer sub.