flwr_oauth2/helpers

Helper functions

Values

pub fn add_if_present(
  d: List(a),
  value: option.Option(a),
) -> List(a)

Appends the value if present a given list

pub fn encode_redirect_uri(
  value: option.Option(uri.Uri),
) -> option.Option(#(String, String))
pub fn generate_random_string(
  chars chars: String,
  length length: Int,
) -> String

Generates a random string from a given list of characters with a given length

pub fn unwrap_both(res: Result(a, a)) -> a
pub fn verify_content_type(
  response resp: response.Response(a),
  expected expected_content_type: String,
) -> Result(Nil, String)

Convenience method that matches if a request contains the correct content type. Returns Ok(Nil) if type matches, otherwise returns an Error with the given content type.

✨ Search Document