Skip to content

Conversation

@dzhurey
Copy link
Collaborator

@dzhurey dzhurey commented Nov 26, 2018

What's this PR do ?

user authentication using Guardian

What are the relevant tickets ?

#6

Where should the reviewer start ?

session_controller.ex

How should this be manually tested ?

  1. Open url /sessions/new
  2. Fill login form and submit
  3. You should be redirected to /users

Any background context you want to provide ?

Deployment notes

Screenshots (if appropriate)

Definition of Done:

  • [x ] Does this PR require Database changes ?
  • [ v] Does this add new dependencies? (network setup, new 3rd party services)
    Guardian
  • [ x] Will this feature require a new piece of infrastructure to be implemented?

"""

use Guardian.Plug.Pipeline,
otp_app: :auth_ex,
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should we using :phoaw ?

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes we should

"test",
"lib/phoaw/application.ex",
"lib/phoaw_web.ex",
"lib/phoaw_web/views/error_helpers.ex"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why skip this files?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We don't use this file yet, so we didn't have test for this file

alias Phoaw.Contents.User

def authenticate_user(username, plain_text_password) do
user = Repo.one(from u in User, where: u.username == ^username)
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can we add method in Contents like:
Contents.find_user_by(email: 'test@example.com')
or
Contents.find_user_by_email('test@example.com')

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants