Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

150
Views
Prevent user from accessing a route depending on its type

I have an app running with React, Redux and Next.js. In my redux store I have a user which has, let's say, an attribute "type". Each type of users has its own array of "routes" it can access.

What is the best way to prevent the user from accessing certain routes ? I am able to redirect with Next.js Middleware but I cannot manage to pass a variable to the request with the user's type.

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

Maybe you can use the type as a parameter at the end of the URL. (See https://www.semrush.com/blog/url-parameters/). These parameters can be accessed in NextJS functions like getInitialProps and getServerSideProps, and also in the client-side using next/router.

Using such parameters, you can handle redirects and/or data-fetches according to the type.

about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!