ueberauth / ueberauth_identity

A username/password Strategy for Überauth
MIT License
80 stars 21 forks source link

undefined function validate_password/1 #20

Closed nelsonic closed 7 years ago

nelsonic commented 7 years ago

I've tried following the docs for ueberauth_identity but getting:

** (CompileError) web/controllers/auth_controller.ex:32: undefined function validate_password/1

Error: https://travis-ci.org/dwyl/auth/builds/215054975#L391 Snapshot of code: https://github.com/dwyl/auth/blob/fe8f18a16695b5c2a4ca08c75a02bcd698c202b2/web/controllers/auth_controller.ex#L32

I searched through the ueberauth org: https://github.com/search?q=org%3Aueberauth+validate_password&type=Code image There's only one place it's referred to and that's in the readme. (no code examples)

also checked all 14 answers on StackOverflow http://stackoverflow.com/search?q=ueberauth (as instructed in your CONTRIBUTING.md but didn't find anything resembling this issue...) image

There are quite a few questions that have no answers or comments ... So I'm asking my question here in the hope of a response.

Is there an example definition for the validate_password/1 function? or can anybody who has successfully implemented ueberauth_identity shed some light on this?

hassox commented 7 years ago

Hey there. The validate password function mentioned in the readme is not implemented by ueberauth_identity. It's used as an example of what your controller might look like. What it means for each app is different. Sorry for the confusion. You need to implement your own function to validate a password/email/username combo

nelsonic commented 7 years ago

@hassox thanks for the quick reply and for clarifying. I read the code of https://github.com/ueberauth/ueberauth_example but could not find an example of validate_password in the auth_controller.ex ... can you point us to an example implementation? (please/thanks!)

doomspork commented 7 years ago

@nelsonic maybe we can look at providing a better example but for now @hassox has a project that implements a similar flow but uses difference function names: https://github.com/hassox/phoenix_guardian