AuthShield v0.0.2 AuthShield.Authentication.Sessions View Source
Session is a temporary authentication information that is stored on server in order to keep the user logged in.
Link to this section Summary
Functions
Gets a AuthShield.Authentication.Schemas.Session
register by its filters.
Gets a AuthShield.Authentication.Schemas.Session
register by its filters.
Creates a new AuthShield.Authentication.Schemas.Session
register.
Creates a new AuthShield.Authentication.Schemas.Session
register.
Checks if the give AuthShield.Authentication.Schemas.Session
is expired
Returns a list of AuthShield.Authentication.Schemas.Session
by its filters
Updates a AuthShield.Authentication.Schemas.Session
register.
Updates a AuthShield.Authentication.Schemas.Session
register.
Link to this section Types
Transactional responses of failed
success_response()
View Sourcesuccess_response() :: {:ok, AuthShield.Authentication.Schemas.Session.t()}
Transactional responses of success
Link to this section Functions
get_by(filters)
View Sourceget_by(filters :: keyword()) :: AuthShield.Authentication.Schemas.Session.t() | nil
Gets a AuthShield.Authentication.Schemas.Session
register by its filters.
Exemples:
AuthShield.Authentication.Sessions.get_by(user_id: "ecb4c67d-6380-4984-ae04-1563e885d59e")
get_by!(filters)
View Sourceget_by!(filters :: keyword()) :: AuthShield.Authentication.Schemas.Session.t() | no_return()
Gets a AuthShield.Authentication.Schemas.Session
register by its filters.
Similar to get_by/1
but returns the struct or raises if the changeset is invalid.
insert(params)
View Sourceinsert(params :: map()) :: success_response() | failed_response()
Creates a new AuthShield.Authentication.Schemas.Session
register.
Exemples:
AuthShield.Authentication.Sessions.insert(%{
user_id: "ecb4c67d-6380-4984-ae04-1563e885d59e",
remote_ip: "173.121.3.0",
user_agent: "Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:47.0) Gecko/20100101 Firefox/47.0",
expiration: ~U[2019-08-23 23:06:50.424629Z]
})
insert!(params)
View Sourceinsert!(params :: map()) :: AuthShield.Authentication.Schemas.Session.t() | no_return()
Creates a new AuthShield.Authentication.Schemas.Session
register.
Similar to insert/1
but returns the struct or raises if the changeset is invalid.
is_expired?(session)
View Sourceis_expired?(session :: AuthShield.Authentication.Schemas.Session.t()) :: boolean()
Checks if the give AuthShield.Authentication.Schemas.Session
is expired
Exemples:
AuthShield.Authentication.Sessions.is_expired?(session)
list(filters \\ [])
View Sourcelist(filters :: keyword()) :: [AuthShield.Authentication.Schemas.Session.t()]
Returns a list of AuthShield.Authentication.Schemas.Session
by its filters
Exemples:
# Getting the all list
AuthShield.Authentication.Sessions.list()
# Filtering the list by field
AuthShield.Authentication.Sessions.list(user_id: "ecb4c67d-6380-4984-ae04-1563e885d59e")
update(session, params)
View Sourceupdate( session :: AuthShield.Authentication.Schemas.Session.t(), params :: map() ) :: success_response() | failed_response()
Updates a AuthShield.Authentication.Schemas.Session
register.
Exemples:
AuthShield.Authentication.Sessions.update(session, %{expiration: ~U[2019-08-30 23:06:50.424629Z]})
update!(password, params)
View Sourceupdate!( password :: AuthShield.Authentication.Schemas.Session.t(), params :: map() ) :: AuthShield.Authentication.Schemas.Session.t() | no_return()
Updates a AuthShield.Authentication.Schemas.Session
register.
Similar to update/2
but returns the struct or raises if the changeset is invalid.