Skip to content

Component: Admin panel. Restrict access based on user role. #41

@olav-valle

Description

@olav-valle
  • Add conditional rendering to Router,
    • with boolean extracted from /user API?
      • Maybe something as simple as isAdmin = (await fetch("/user").then(response => response.json())).authorities.some(a => a.authority === "ROLE_ADMIN")?
    • Or using JWT? That seems to be the "correct" way.

Reading:
Add Auth to React App
Spring.io: React and Spring, part 5: Security
Spring.io: Security Architecture Topic
Baeldung: React and Spring Security
guides.grails.org: React App with Spring Security

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions