firebase / firebase/firebase-admin-node

[FR] Multi-Tenancy doesn't check for existence of a tenant

Open
#700 19 comments 0 reactions 1 assignee Assigned to @wuyanna View on GitHub
api: auth type: feature request
Dominant language
TypeScript
Stars
1.7k
Forks
419
Avg merge
3d 10h
Merged PRs (30d)
16

Description

**Is your feature request related to a problem? Please describe.**
The issue is related with the creation of a tenant using the sdk server side. The sdk is missing a way to check if the tenant (the displayName to be precise) already exist in the project. The sdk will create a tenant with a different id but with the same name if the create operation is performed multiple times with the same parameter. I do understand that the sdk distinguish the tenants using the id, but it is not very friendly.

**Describe the solution you'd like**
It would be much better if the sdk would mock the behavior and strategy used in the creation of a user (it checks for example if the email is already in use, and if it is it throws an exception). The sdk checks if the displayname is already taken and if so throw an exception. This feature could easily been optional, and the developer decide if enforce it.

**Describe alternatives you've considered**
For now I am just checking if the displayname exist in a json object that works as map between tenant's name and tenant's id. It easier to deal with a name (decided upfront by the developer) than relies on an ID automatically generated by the cloud.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.