howdy/authentication/cookie
Types
pub type CookieConfig {
CookieConfig(
cookie: Option(Attributes),
session_storage: Option(SessionStorage),
timeouts: Option(Timeouts),
)
}
Constructors
-
CookieConfig( cookie: Option(Attributes), session_storage: Option(SessionStorage), timeouts: Option(Timeouts), )
pub type SessionStorage {
SessionStorage(
insert: fn(String, String, Int, List(#(String, String))) ->
Bool,
lookup: fn(String) ->
Result(
#(String, String, Int, List(#(String, String))),
Nil,
),
delete: fn(String) -> Bool,
)
}
Constructors
-
SessionStorage( insert: fn(String, String, Int, List(#(String, String))) -> Bool, lookup: fn(String) -> Result(#(String, String, Int, List(#(String, String))), Nil), delete: fn(String) -> Bool, )
Functions
pub fn authenticate_with_cookie(context: Context(a)) -> Result(
User,
Nil,
)
pub fn new_with_config(cookie_config: CookieConfig) -> Nil
pub fn sign_in(username: String, password: String, remember_me: Bool, successful_response resp: Response(
a,
), login_fn fun: fn(String, String) ->
Result(List(#(String, String)), b)) -> Result(
Response(a),
Nil,
)