Login with Google (pull and use id on page 2)

here you try to play a trick,

image

instead of getting get id token, use set global token to get tinydb get tag ( token) value (get token)

:wink:

so nexttime while login it will try to use the same token


I guess it’s true. I’m testing now /// I have tested. The only thing that has changed is that the articles did not rank higher.
bumu

why do you getting tag?? i told to get tinydb token value alone, there by next time while login , it will not over write the exisiting value, nor sure how for it will work


image

image

I get an error that you are not logged in. Email and name of users in Firebase are blank.

So every time login the id token value is changing
 Why dont you use anyother method?

i mean, by using that extension, you use login via any email (but tell the use to use gmail only accepted)

once they sign in(save email, token), get uid token (it wont change just like firebase authendication i tested it). When they login success enable taifun gmail account picker(get it from community)

If the taifun gmail picker matches with email they used to sign mean, allow for the next step


Actually, if you look at it, I logged in with google before. But when he showed me this method, I thought I should do something different.

All I was trying to do is I wanted my phone to recognize the user UID when it switches from screen1 to Screen2 and let me write to firebase.

Now, I guess I need to go back and set the email login, then teleport to Page 2, then it should recognize my UID and get permission to write to the page.

I really don’t know this place, I can’t. And that’s what I always ask.

In your firebase rules you are setting it to allow reading in the tags that have the UID (the user identifier).

But in your firebase structure there is no UID. You must create a tag with the UID of each user and inside this tag each user will be allowed to write or read what you want.

As you can see in the image, you have a label called “users” and inside are the UIDs.

And in the rules the “users” tag is defined and then the “uid” of each user.

{
“rules”: {
“users”: {
“$uid”: {
“.read”: “$uid === auth.uid”,
“.write”:"$uid === auth.uid"
}
}
}
}

So what you have wrong is the structure of your firebase database, which does not match with the rules you have put in it

Of you check up with my earlier post, see, under user it is writing uid of every logged in devices and under each uid then i am saving their email . But in your case there is no such action is happening
 Under user directly it is writing email??? See to that .

Do I need to collect all headers under users?
Ekran Alıntısı

What I have to do in order.

1- Build a recording platform.
2- Save the user UID in firebase.
3- To the Rules section
{
“Charter”: {
“users”: {
“$uid”: {
“.read”: “$uid === auth.uid”,
“.write”:"$uid === auth.uid"
}
}
}
}

Write these rules.

4- Send registered user to page 2.
5-Registered users can now write and read the information on the 2nd page.

Now if I set the rules so that only registered users can write to “users”. they cannot write during registration and their UID is not saved.

Anyone can write the ‘users’ rules I need to do. but only registered users can read it.

when i get past page 2

{
“Charter”: {
“stain”: {
“$uid”: {
“.read”: “$uid === auth.uid”,
“.write”:"$uid === auth.uid"
}
}
}
}

If I write this in addition to the rules, only registered users will be able to read and write the ‘spot’ title.

I need to write separate maid for each title.

The ‘bildirim’ can be read by logged in people. should write the manager.
‘spot’ can be read by logged in people. should write the manager.
‘guncel’ logged in people can read it. should write the manager.
‘Users’ section. Everyone should be able to write and everyone should be able to read.

{
“rules”: {
“spot”:{
“$user_id”: {
“.read”: “$user_id === auth.uid”,
“.write”: “$user_id == ‘sqSbtXDltignIh0aIE1LsX1klxu1’”

  }

}
,“guncel”:{
“$user_id”: {
“.read”: “$user_id === auth.uid”,
“.write”: “$user_id == ‘sqSbtXDltignIh0aIE1LsX1klxu1’”

  }

}
,“bildirim”:{
“$user_id”: {
“.read”: “$user_id === auth.uid”,
“.write”: “$user_id == ‘sqSbtXDltignIh0aIE1LsX1klxu1’”

      ,"users": {
        ".read": true,
          ".write": true
      }

}
}
}
}

Since this method doesn’t work, I delete them all and try new blocks.

FirebaseError Permission denied




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