Compare commits

...
2 Commits
Author SHA1 Message Date
KKlochko 01efdc201d Update the docker image for the CI/CD pipeline.
continuous-integration/drone/tag Build is passing
2024-08-05 21:56:02 +03:00
KKlochko 8a423b721d Add ErrorHandler for API Auth.
continuous-integration/drone/push Build is failing
continuous-integration/drone/tag Build was killed
2023-08-12 21:02:05 +03:00
3 changed files with 17 additions and 4 deletions
+3 -3
View File
@@ -12,7 +12,7 @@ environment:
steps: steps:
- name: install dependencies - name: install dependencies
image: elixir:1.14.0-slim image: elixir:1.14.0
volumes: volumes:
- name: mix - name: mix
path: /root/.mix path: /root/.mix
@@ -23,7 +23,7 @@ steps:
- mix compile - mix compile
- name: run migrations - name: run migrations
image: elixir:1.14.0-slim image: elixir:1.14.0
volumes: volumes:
- name: mix - name: mix
path: /root/.mix path: /root/.mix
@@ -31,7 +31,7 @@ steps:
- mix ecto.setup - mix ecto.setup
- name: run tests - name: run tests
image: elixir:1.14.0-slim image: elixir:1.14.0
volumes: volumes:
- name: mix - name: mix
path: /root/.mix path: /root/.mix
+4 -1
View File
@@ -43,7 +43,6 @@
** 0.4.10 <2023-08-03 Thu> ** 0.4.10 <2023-08-03 Thu>
Add the CI/CD configuration. Add the CI/CD configuration.
Add the test config. Add the test config.
** 0.5.1 <2023-08-04 Fri> ** 0.5.1 <2023-08-04 Fri>
Add a generator for Link with random shorten. Add a generator for Link with random shorten.
Update Links.create_one to use a function. Update Links.create_one to use a function.
@@ -63,3 +62,7 @@
Add the auth pipeline for the Link API path. Add the auth pipeline for the Link API path.
** 0.8.3 <2023-08-11 Fri> ** 0.8.3 <2023-08-11 Fri>
Add tests for user login. Add tests for user login.
** 0.8.4 <2023-08-12 Sat>
Add ErrorHandler for API Auth.
** 0.8.5 <2024-08-05 Mon>
Update the docker image for the CI/CD pipeline.
@@ -0,0 +1,10 @@
defmodule LinkShortenerWeb.Auth.ErrorHandler do
import Plug.Conn
def auth_error(conn, {type, _reason}, _opts) do
body = Poison.encode!(%{error: to_string(type)})
conn
|> put_resp_content_type("application/json")
|> send_resp(401, body)
end
end