ShelterTechSF / askdarcel-api

Backend of the "Ask Darcel" app.
GNU General Public License v3.0
8 stars 24 forks source link

Add login page route for auth0 #718

Closed wi11 closed 1 year ago

wi11 commented 1 year ago

With this change, we can access the login page at /auth/auth0. After login, we are successfully redirected to the callback page which i just set as /api-docs for now.

lgarofalo commented 1 year ago

With this change, we can access the login page at /auth/auth0. After login, we are successfully redirected to the callback page which i just set as /api-docs for now.

We can access /auth/auth0 on the api server via the frontend path /api/auth/auth0, this seems to work by default, so if we were to deploy this, we would need no other changes to access it in staging.

Example from dev

askdarcel-api-api-1  | /usr/src/app/app/controllers/auth0_controller.rb:8: warning: URI.escape is obsolete
askdarcel-api-api-1  | method=GET path=/auth/auth0 format=html controller=Auth0Controller action=authentication status=302 duration=2.22 view=0.00 db=0.00 location=https:///authorize
lgarofalo commented 1 year ago

If we need to hush up robocop linting, we can do that, some examples are in the codebase, we can also add to .rubocop.yaml

lgarofalo commented 1 year ago

Seems good to me for testing, we'll need to make sure the env configs are wired in properly and I can add those to staging in advance if you share with me what key/values to use.

richardxia commented 1 year ago

If we need to hush up robocop linting, we can do that, some examples are in the codebase, we can also add to .rubocop.yaml

I would strongly request that we don't silence these lint failures; they're due to inconsistently indenting sibling methods with both 2 and 4 spaces. I would really prefer that all methods in the same scope be indented by the same amount (and I would also really prefer consistently using the same indentation style for the entire codebase).