0

I'm building an application where I have used Firebase as a real-time database for Login and Registration and I have successfully managed to achieve it.

Here's where I'm stuck at, I want to create two login pages in the app where a few selected users should have the access to the second login activity and the rest of the users shouldn't have access to log in. I can achieve this using two databases but Firebase charges for that, So please guide me on how to allow specific users to have access to login into the second login activity.

Update guys! I have successfully found a solution to my issue with a simple change in the line. All I did was change the Database Reference name (two different names have created two nodes in the real-time database) allowing me to create two login pages for two different users.

Many thanks to those who provided suggestions and helped me make progress in building the app!

  • 1
    How will you identify that specific user? Do you have any id (or similar) for that? – ʀᴀʜɪʟ Dec 07 '21 at 10:40
  • I don't think there's a way for that, or atleast no intended strategy to implement such request, I'd recommend creating a collection of users organized by auth.uid and you can keep whatever kind of permission attributes you want in there, or implement role-based access control. – reinskywalker Dec 07 '21 at 11:16
  • Are you asking how to handle user types? If so, see https://stackoverflow.com/q/36452841, https://stackoverflow.com/a/66822535, https://stackoverflow.com/a/63543214, and more that are linked from those. – Frank van Puffelen Dec 07 '21 at 15:01
  • Thanks, everyone for responding! Let me try using auth.id! – Harshavardhan N Dec 07 '21 at 17:56
  • 1
    Please provide enough code so others can better understand or reproduce the problem. – Community Dec 13 '21 at 00:24
  • Update guys! I have successfully found a solution to my issue with a simple change in the line. All I did was change the Database Reference name (two different names have created two nodes in the real-time database) allowing me to create two login pages for two different users. – Harshavardhan N Dec 21 '21 at 14:53

0 Answers0