Packages

Integration with the Auth API from Supabase services. Provide authentication with MFA, password and magic link.

Retired package: Renamed - this package was renamed to supabase_gotrue

Current section

Files

Jump to
supabase_auth lib supabase go_true pkce.ex
Raw

lib/supabase/go_true/pkce.ex

defmodule Supabase.GoTrue.PKCE do
@moduledoc false
@verifier_length 56
def generate_verifier do
@verifier_length
|> :crypto.strong_rand_bytes()
|> Base.url_encode64(padding: false)
|> String.slice(0, @verifier_length)
end
def generate_challenge(verifier) do
:sha256
|> :crypto.hash(verifier)
|> Base.url_encode64(padding: false)
end
end