greenlight icon indicating copy to clipboard operation
greenlight copied to clipboard

AuthZ (FE): Added `AuthenticatedAndActiveOnly` & `UnauthenticatedOnly` protected routes.

Open KH-Amir-TN opened this issue 2 years ago • 3 comments

Description

Added AuthenticatedAndActiveOnly & UnauthenticatedOnly protected routes.

Testing Steps

  1. Pull the code.
  2. Install the dependencies bundle install && npm|yarn install.
  3. Clean the previous assets build by running rm app/assets/builds/* (This won't remove .keep since it's hidden).
  4. Clean the database and tmp files for a better isolation by running rails tmp:clear && rails db:schema:cache:clear && rails db:drop && rails db:create && rails db:migrate:with_data
  5. Run the linter and specs bundle exec rubocop --parallel && bundle exec rspec && npx eslint app/javascript/* --ext .jsx,.js
  6. Run ./bin/dev to run the assets builders processes and the Puma server all at once.

Screenshots (if appropriate):

KH-Amir-TN avatar Sep 27 '22 10:09 KH-Amir-TN

I find the syntax slightly odd here - can we not create a component that does whatever checks is needed and then returns Route instead? That way Route and ProtectedRoute are interchangeable?

farhatahmad avatar Sep 28 '22 15:09 farhatahmad

I find the syntax slightly odd here - can we not create a component that does whatever checks is needed and then returns Route instead? That way Route and ProtectedRoute are interchangeable?

Unfortunately, that seems to be unfeasible with the current version of react router. Will provide detailed explanation during today's meeting,

KH-Amir-TN avatar Oct 03 '22 09:10 KH-Amir-TN

This is only an increment, The complete UX will be achieved once all subsequent PRs gets merged,

KH-Amir-TN avatar Oct 18 '22 14:10 KH-Amir-TN

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

sonarqubecloud[bot] avatar Oct 18 '22 14:10 sonarqubecloud[bot]