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,
    )
pub type Timeouts {
  Timeouts(short: Int, long: Int)
}

Constructors

  • Timeouts(short: Int, long: Int)

Functions

pub fn authenticate_with_cookie(context: Context(a)) -> Result(
  User,
  Nil,
)
pub fn new() -> 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,
)
pub fn sign_out(context: Context(a), successful_response resp: Response(
    b,
  )) -> Response(b)