-
Notifications
You must be signed in to change notification settings - Fork 41
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
protocol String.Chars not implemented for %{"email_verified" => "false"} of type Map #20
Labels
Comments
nelsonic
added
bug
Something isn't working
help wanted
Extra attention is needed
chore
labels
Dec 5, 2019
nelsonic
added a commit
that referenced
this issue
Dec 5, 2019
nelsonic
added a commit
that referenced
this issue
Dec 5, 2019
nelsonic
added a commit
that referenced
this issue
Dec 5, 2019
SimonLab
added a commit
that referenced
this issue
Dec 5, 2019
Transform map keys to atoms issue #20
It still have the error even with the atoms The way are been call is like this:
|
nelsonic
added a commit
to dwyl/elixir-auth-github
that referenced
this issue
Feb 1, 2020
GOTO: #28 (issue for discussing this) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Part of documenting #10 this package is attempting to create an app that uses the package from scratch. I am creating the absolute minimum steps example in: https://github.com/dwyl/auth-demo
When I attempt to access the
"email_verified"
property of theprofile
(returned by Google)in a template e.g:
I see the following error:
This is very unfriendly to end users (the beginners who are attempting to consume the package).
This is partly
Elixir
being unfriendly and partly our fault for not making theprofile
map easier to use.I feel we could improve this by transforming the keys of the
profile
map from strings to atoms.https://stackoverflow.com/questions/31990134/convert-map-keys-from-strings-to-atoms-in-elixir
Specifically in the
parse_body_response
currently:elixir-auth-google/lib/elixir_auth_google.ex
Lines 38 to 45 in 687fba5
Could be:
So that instead of returning a Map where they keys are strings:
The
parse_body_response
would return a Map where the keys are atoms:The text was updated successfully, but these errors were encountered: