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

Multi-tenancy support #271

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Conversation

rinfimate
Copy link

No description provided.

@@ -35,7 +36,7 @@
"tslint-config-prettier": "^1.18.0",
"typescript": "4.5.5"
},
"homepage": "https://github.com/benwinding/react-admin-firebase",
"homepage": "https://github.com/rinfimate/react-admin-firebase",

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

none of the changes in this file besides the dependency should be part of the pull request

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You might need to make another branch on your fork say rinfimate:add-multi-tenant-support in order to only merge in changes that are necessary (you then can update this PR with the new branch)... otherwise you'll need to change your master branch to remove these changes

Copy link
Owner

@benwinding benwinding left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the contribution @rinfimate just need some more details and to cleanup package.json before merging

@@ -35,7 +36,7 @@
"tslint-config-prettier": "^1.18.0",
"typescript": "4.5.5"
},
"homepage": "https://github.com/benwinding/react-admin-firebase",
"homepage": "https://github.com/rinfimate/react-admin-firebase",
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You might need to make another branch on your fork say rinfimate:add-multi-tenant-support in order to only merge in changes that are necessary (you then can update this PR with the new branch)... otherwise you'll need to change your master branch to remove these changes

Comment on lines +190 to +203
public async HandleGetTenant() {
try {
const user = await this.getUserLogin();
// @ts-ignore
const token = await user.getIdTokenResult();
const decodedToken:any = jwt_decode(token.token);
return decodedToken["firebase"]["tenant"];
} catch (e) {
log('HandleGetTenant: no user is logged in or tokenResult error', {
e,
});
return null;
}
}
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we add to the README on how this works? 🙏

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants