Skip to content
This repository has been archived by the owner on Nov 6, 2021. It is now read-only.

Require a password when first creating a user #53

Closed
armahillo opened this issue Nov 18, 2018 · 2 comments
Closed

Require a password when first creating a user #53

armahillo opened this issue Nov 18, 2018 · 2 comments

Comments

@armahillo
Copy link
Collaborator

Pulled from a TODO in /app/services/partner_service.rb:

# TODO: Validation should not be skipped. Password should not be required when first creating a user

This may require adjustment of the Partner creation process, or a default secure password created that is emailed to the user.

@seanmarcia
Copy link
Member

I don't think we're using the partner_service -- I think we're using the Devise Invitable gem instead. If you look at the /api/vi/partners_controller.rb you'll see that we are creating users via invite!

    partner = Partner.invite!(email: partner_params[:email],
      diaper_bank_id: partner_params[:diaper_bank_id],
      diaper_partner_id: partner_params[:diaper_partner_id])

I think it might make more sense for this issue to determine if we are using the partner_service.rb and if not, remove it.

@dacur
Copy link
Contributor

dacur commented Nov 26, 2018

I tested this locally. I created a Partner from the rails console using Partner.invite!(email: "david.curtis@smashingboxes.com") - note: a bank_id and diaper_partner_id were not required. I was able to click on the link in the email, which then allowed me to set a password and log into the app.

If bank_id and diaper_partner_id are actually supposed to be required, then a bug should probably be logged. Otherwise, like Sean mentioned, I think the only thing left to do is determine whether or not you need the partner service (and I'm not familiar enough w/ this app yet to offer an opinion).

I also tried to create a partner manually without an email or password and received the errors @messages={:email=>["can't be blank"], :password=>["can't be blank"]}, so it seems like things may be set up correctly.

I hope this is helpful 😄

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants