Directed Login of user

Good afternoon
I’m using the translator, because I’m Brazilian
I have an application and I need to direct it to specific forms according to its occupation example:

  • Email and password authentication using Firebase Authentication

  • User bank using Firebase Realtime Database

Fields:

  • Photos
  • school
  • occupation
  • email
  • password

I was able to store the correct data
I log in right
Only now I want to do the following and I’m not getting it

If the occupation is equal to the student opens the student screen
If the occupation is equal to the teacher opens the teacher screen

I am not able to search for this field in the table, and compare if the user is a student or teacher.
I would like a little help,

If you the blocks that you haved in your project, you will get solution soon

How you are getting the occupation? Either user have to enter or have choose from the list

Suppose if you use spinner component for getting occupation with only two values such as Student and teacher and upon successful login , use the below blocks to redirect them… simple

I did it like this, in the registration, he chooses if he is a student or teacher,
In the login screen he only has the email and password, he has no option to choose whether he is a student or a teacher.
I wanted to see how to get this information from the bank, since in authentication it is only through the email and password field.
Look at the image below …
Registration screen he chooses the occupation …
Login screen does not have

On the authentication screen, I wanted to see a way to capture the user’s occupation, perhaps by linking to the user’s id and looking for the occupation field and placing it in a global variable and then comparing whether he is a student or a teacher.

As per your block, after the successful login they will enter into Home Screen… In that screen only registration page you designed. Correct?

Yes, I modeled the code a bit, I will explain and display its screen.

  1. initialize with a global variable;

  2. I use the GET VALUE of the firebese, to search the OCCUPATION field of the user ID, only there I am typing, I wanted it to be automatic when it authenticates itself.

  3. I authenticate by email and password, only that user’s id has to appear in the place where it was entered statically, it would have to be automatic.

  4. There I take the variable and make the comparison, then if you are a teacher, open the teacher screen, if not the student screen.
    the user id of option 4 wanted it to appear in item 2, so I think it would be automatic.

First: Welcome

Second , make 2 apps
One for student
One for teacher

  1. How many screens are there?
  2. Users first have to register or authenticated?
  3. Did you specific any rule in firebase?
  4. You cant save/retrieve the details into/from the firebase without authentication.

So please provide few more details to give clear cut information or blocks to resolve your query.

Apps or screen??

Apps.

They are apps with different goals.

They are app with different routines.

@Letreiro_Digital

What routines will be used by teachers?

Need to be in an app?

Para esse momento, seria dois tipos de usuários;

  1. Um seria o professor e outro o aluno;
  2. São duas telas diferente;
  3. Professor posta alguns textos ;
  4. O aluno visualiza esse testo, reproduz em áudio e salva e gera pontuação;
  5. Depois o professor vai visualizar a pontuação desse aluno;

Também vou fazer uma rotina pra testar se esse professor existe ou não na base de dados, mas nesse momento é só para mostrar um projeto básico para um projeto maior mais adiante, pois ainda não existe uma base de dados para alunos e professores.

  1. Serão no máximo umas 10 telas, talvez até menos, sendo que o login e o registro eu uso a mesma tela;
  2. Os usuários primeiro precisam se registrar, esse dados armazenado no Database do Firebase;
  3. Após o registro os usuários se autenticam, uso o a autenticação do google., omo mostrei na imagem anterior;
  4. não coloquei nenhuma regra no firebese ainda, pois ainda estou me adaptando a essa estrutura de armazenamento de dados

Seira mais o menos isso vai ter no app, vou duplicar esse post em português, pois a tradução dele deve de ser tenso.

For that moment, it would be two types of users;

  1. One would be the teacher and the other the student;
  2. There are two different screens;
  3. Teacher posts some texts;
  4. The student visualizes this text, reproduces it in audio and saves and generates scores;
  5. Then the teacher will see that student’s score;

I will also make a routine to test whether or not this teacher exists in the database, but at that moment it is only to show a basic project for a larger project later on, as there is still no database for students and teachers.

  1. There will be a maximum of 10 screens, maybe even less, being that the login and the registration I use the same screen;
  2. Users first need to register, this data is stored in the Firebase Database;
  3. After registration, users authenticate, use google authentication., As shown in the previous image;
  4. I haven’t put any rules on firebese yet, as I’m still adapting to this data storage structure

Seira more or less this will have in the app, I will duplicate this post in Portuguese, because the translation of it must be tense.

Separate the routines into 2 apps. Updating one app will not affect the other app. Update independently.

You don’t need to use multiple screens. Use several vertical arrangement. There are posts explaining this.

Sim, eu uso arranjos verticais, foi assim que eu fiz no login e cadastro, também será assim para as demias telas.
Penso sim em fazer 2 app, mas como não tenho uma base de dados ai nda para realizar as validações em ambos os casos, logo então pensamos em colcoar ambos em uma mesmo app, só que redirecionando para telas especificas.

Nesse momento só queria saber como jogar o USER ID do login Sucess em uma váriavel e usar ela para buscar o campo ocupação dentro do GET VALUE.,

Updated:

Screenshot_3

I have tried with this block,working fine and tested

While app initialize , it will check whether user is authenticated or not. If he is authenticated also will check his occupation and will proceed to the concern screen. If he is not authenticated below steps will allowed

step 1: User need to register
( if success Sign up VA will open, Reg VA will invisible, details will store in firebase DB and the occupation will store in tinyDB)
Step2: User need to sign up with email and pwd.
step3: User need to sign in
step4: Next screen will open as per the input data given in occupation

Simple

No need to use get value from firebase. However user need to register their details while first time entering into the app. So store the details in to the tinyDB. Now firebase will give you the details like who and all registered

And one more thing, do not use other language except English. Please delete it or re-modify it.

I found it interesting,
I will record it locally, then analyze if it is already or registered
Otherwise, it requests authentication.
I’ll see if I can do this, I’m new to this type of development, but calmly I get there, if you can give a print of the design of the screen, it will make it easier for me.
I agree with you on the English question.
I’ll try to see if I can get it here.