-module(howdy@context). -compile(no_auto_import). -export([new/2, is_authenticated/1]). -export_type([context/0]). -type context() :: {context, list(howdy@url_parser:url_segment()), gleam@http@request:request(bitstring()), gleam@option:option(howdy@context@user:user())}. -spec new( list(howdy@url_parser:url_segment()), gleam@http@request:request(bitstring()) ) -> context(). new(Url, Request) -> {context, Url, Request, none}. -spec is_authenticated(context()) -> boolean(). is_authenticated(Context) -> case erlang:element(4, Context) of {some, _@1} -> true; none -> false end.