Skip to content
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

Auto login after create registraion #325

Open
dokuzbir opened this issue Jan 17, 2018 · 4 comments
Open

Auto login after create registraion #325

dokuzbir opened this issue Jan 17, 2018 · 4 comments

Comments

@dokuzbir
Copy link

I searched functions but i couldnt find. Is there a way to achieve that in functions?

@renanvy
Copy link

renanvy commented Jul 6, 2018

In the redirects.ex file generated by Coherence, you need to make a redirect to the login url. Like this:

import CampusLabWeb.Router.Helpers

def registration_create(conn, _), do
  redirect(conn, to: session_path(conn, :create), method: :post)
end

@vDupindev
Copy link

vDupindev commented Sep 1, 2018

If i use this redirection, i have this error :
no route found for GET /sessions (MyApp.Router)

I just want to simulate a connexion (with login and password) from the home page.

@renanvy
Copy link

renanvy commented Sep 1, 2018

In Coherence settings you need to set this: allow_unconfirmed_access_for: 1 and in the redirects.ex file you do not have to do anything

config :coherence,
  user_schema: ProjectWeb.Accounts.User,
  repo: ProjectWeb.Repo,
  module: ProjectWeb,
  web_module: ProjectWeb,
  router: ProjectWeb.Router,
  messages_backend: ProjectWeb.Coherence.Messages,
  logged_out_url: "/",
  email_from_name: "Campus Lab",
  email_from_email: "yourname@example.com",
  minimum_password_length: 6,
  allow_unconfirmed_access_for: 1

@vDupindev
Copy link

Perfect Thank you !

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

No branches or pull requests

3 participants