Login signup problems with admin

i am making a login/register app that based if your a admin or user it takes to you a different screen
but it only works for my users. Its like the projectbucket doesnt change and its only set to users on data base here is the code

and thats the database

Hi

Your code has switched Screens before the Admin Project Bucket is set?

yea for Users it works just fine

...Since the code switches Screens for Users, the code for Admin never gets executed.

i have different username and password for admins and users so the if for the users is false and go to else to check for the admin login but for some reason it doesnt exute the command set bucketproject to Admin

I think the issue then is that the Admin Bucket is not initialised quickly enough when your code goes straight to testing for Admin ID + Password. It's unusual to get a Db value and then ask for passwords, do you do that in order to know the Db is ready?

Re-Arrange your GUI so that the App User selects Client or Admin Screen, then from the specific screen, set the specific Project Bucket and test ID + Password input there.

you are right Admin Bucket is not initialised quickly enough so i re-arranged it but in a different way i added a button for admin login and now i set the admin bucket the momement i press the button and now it works.Also added 1 more if else to check what the project bucket is so it will only check the admin or users project bucket here is the code

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.