Saving information into the database

Oh… That’s true. This is very tricky. Do you think there’s a way I can call the user ID while doing the sign up procedure?

I make my users sign in before they can access any of the features of the app. That way I already have their userId.

Why there is only a Sign Up without a Sign In?

A Sign up is to create the account in Firebase the first time. When you create it you should then use Sign In instead.

Using Sign Up every time should actually gives error.

2 Likes

I do have a sign up and sign in system. It’s just that when the user is signing up, I’m having them choose a profile picture. Since I can’t really store that profile picture under the User ID when the user signs up, I’m going to store it under a secure password. The secure password is going to require specific details to reduce the chances of a user picking the same password as someone else.

1 Like

In Firebase there are 2 Sign Up methods for email.

You have a sign up without email verification and the other with verification.

If you used the one with verification then Firebase will only provide UserID when using Sign In block.

So use the Sign In block to get the UserID and save the profile picture under it

I’m not really sure how I can use the User ID when I store the Image URL when the user signs up because the user has to sign up first and then User ID is retrieved after the user signs in

1 Like

The way Firebase works is:

  • Sign Up is to register the user credential in the database. If email verification is selected in the Firebase Authentication module setup then an email will be sent and the user need to activate the signing.
  • Sign In is the one that provides you access to the database and will provide a UserID.

The Sign Up block should not be used to access the data.

You’re combining several steps. When you upload a photo to Cloudinary, you can just assign the mediaURL value to a variable. And then after the user signs in, save that variable value to Firebase.

2 Likes

Oooh!! Ok, thank you again!! I got to save the image URL under the User ID by doing that. Thanks for all the help.

2 Likes