mirror of
https://github.com/kevin-DL/phoenix_api_template.git
synced 2026-01-12 02:55:13 +00:00
Adding the user to the session
This commit is contained in:
@@ -29,6 +29,7 @@ defmodule PhoenixApiTemplateWeb.UserController do
|
||||
case Guardian.authenticate(email, password) do
|
||||
{:ok, user, token} ->
|
||||
conn
|
||||
|> Plug.Conn.put_session(:user_id, user.id)
|
||||
|> put_status(:ok)
|
||||
|> render("user_token.json", %{user: user, token: token})
|
||||
|
||||
|
||||
Reference in New Issue
Block a user