Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Nest everything within company and store currentCompany => company object on session #65

Closed
dahal opened this issue Jan 23, 2024 · 2 comments
Labels
😍 ENHANCEMENT New feature or request

Comments

@dahal
Copy link
Contributor

dahal commented Jan 23, 2024

OpenCap is a multi tenant application. Which means users needs to be able to toggle between companies pretty easily, when doing so:-

CleanShot 2024-01-23 at 00 51 40

  1. During initial onboarding, store company object as currentCompany on session so there is no conflict on which company's data to fetch (on server side)
  2. Replace /dashboard by /:companyId and nest all children (pages) within /:companyId.
  3. Render 404 if logged in user does not have access to the company
  4. Fetch companies (server side) to get list of companies to show on the navbar.
  5. When you toggle between companies, redirect users to respective routes: eg: opencap.co/:companyId/stakeholders
  6. When a logged in user is on /signup or /login page with currentCompany object on their session, redirect them currentCompany's page. That is: /:companyId, if they do not have currentCompany on session, redirect them to /onboarding

Reference

@dahal dahal added 😍 ENHANCEMENT New feature or request 🙏 HELP WANTED labels Jan 23, 2024
@G3root
Copy link
Collaborator

G3root commented Jan 23, 2024

picking this up

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
😍 ENHANCEMENT New feature or request
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

2 participants