Last active
March 23, 2019 20:49
-
-
Save zoltanarvai/727f540f1b6a3ded8d01e8beb08d10c7 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
defmodule Auth.Guardian do | |
@moduledoc """ | |
This is the main Guardian module used by the application to gain access to claims, | |
identity, token, etc. | |
Implements callback to properly integrate with Auth0. | |
""" | |
use Guardian, otp_app: :orders | |
alias Auth.Identity | |
@impl Guardian | |
@doc false | |
def resource_from_claims(%{"sub" => "auth0|" <> id} = claims), do: {:ok, %Identity{id: id}} | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment