Add the API Authentication.
continuous-integration/drone/push Build is failing
continuous-integration/drone/tag Build was killed

This commit is contained in:
2023-08-06 21:35:42 +03:00
parent cde8970b46
commit 93631f195f
6 changed files with 36 additions and 37 deletions
@@ -1,20 +1,12 @@
defmodule LinkShortenerWeb.Api.V1.UserView do
use LinkShortenerWeb, :view
alias LinkShortenerWeb.UserView
def render("index.json", %{users: users}) do
%{data: render_many(users, UserView, "user.json")}
end
alias LinkShortenerWeb.Api.V1.UserView
def render("show.json", %{user: user}) do
%{data: render_one(user, UserView, "user.json")}
end
def render("user.json", %{user: user}) do
def render("user.json", %{user: user, token: token}) do
%{
id: user.id,
email: user.email,
encrypted_password: user.encrypted_password
token: token
}
end
end