Skip to content
This repository has been archived by the owner on Jan 19, 2022. It is now read-only.

Disable confirmation #96

Closed
jhonathas opened this issue Apr 1, 2017 · 2 comments
Closed

Disable confirmation #96

jhonathas opened this issue Apr 1, 2017 · 2 comments

Comments

@jhonathas
Copy link

How do I proceed so that a registration already starts confirmed and the user logged in?

I ended up creating everything with the --confirmation option, but I do not need it any more.

@riverrun
Copy link
Owner

riverrun commented Apr 2, 2017

There are quite a few differences between the --confirm option and the default one.

The first thing you would need to do is remove the confirmed_at field in the database. Then it will be usable, and your users will be able to log in.

I can give you more information, and a complete diff, later.

@riverrun
Copy link
Owner

Here's the fuller guide (as I said, there are quite a few differences):

remove the following files:

lib/welcome/mailer.ex
web/controllers/password_reset_controller.ex
test/controllers/password_reset_controller_test.exs
web/templates/password_reset/edit.html.eex
web/templates/password_reset/new.html.eex
web/views/password_reset_view.ex

remove the following from the priv/repo/migrations/create_user.exs file

add :confirmed_at, :utc_datetime
add :confirmation_token, :string
add :confirmation_sent_at, :utc_datetime
add :reset_token, :string
add :reset_sent_at, :utc_datetime

remove the following from the web/models/user.ex file

field :confirmed_at, Ecto.DateTime
field :confirmation_token, :string
field :confirmation_sent_at, Ecto.DateTime
field :reset_token, :string
field :reset_sent_at, Ecto.DateTime

also remove the DB.add_confirm_token(key) line and the reset_changeset function

remove the confirm_email and password_reset routes from the web/router.ex file

remove all references to confirmation in the following files:

web/controllers/session_controller.ex
web/controllers/user_controller.ex
test/controllers/session_controller_test.exs
test/controllers/user_controller_test.exs
test/support/test_helpers.ex

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

2 participants