akash-network / akash-network/console

Implement Auth0 middleware in the API

Open
#761 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
264
Forks
94
Avg merge
18h 49m
Merged PRs (30d)
297

Description

Recently we allowed credentials to be sent to the server be able to utilize cloudflare protections. This made possible to send cookies to the server. In turn this makes auth proxy redundant. We need to add similar logic to auth middleware on the api to be able to get rid of the proxied requests.

Acceptance criteria:

  • api auth middleware is able to verify a user by auth0 session cookie
  • /v1/start-trial is not proxied when user is logged in
  • /v1/start-trial sends the cookies to the API

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with apps/api/src/auth/services/auth.interceptor.ts and compare it with apps/deploy-web/src/pages/api/proxy/[...path]. Then inspect the /v1/start-trial calls in apps/deploy-web/src/services/managed-wallet-http/managed-wallet-http.service.ts. Done means the API verifies the Auth0 session cookie and logged-in requests send cookies directly to the API without the proxy.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
api, authentication, backend
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.