Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

UserID #49

Open
daremeapp opened this issue Oct 13, 2021 · 4 comments
Open

UserID #49

daremeapp opened this issue Oct 13, 2021 · 4 comments

Comments

@daremeapp
Copy link

I'm adding some custom features, but are most used to firebase auth. Can you help me with the how to identify the user in a new page? Ps. Love your work!

@dshukertjr
Copy link
Owner

dshukertjr commented Oct 13, 2021

Hi @daremeapp!

Thank you for the kind words! It really means a lot to me!

Sure, I can try to help you out! What exactly do you mean by "identify the user in a new page"? Do you mean to get their user_id?

@daremeapp
Copy link
Author

Yes, correct. I'm use to work with firebase, so going out to supabase is a bit confusing for me. But I said before, I just love what your have done her.

@daremeapp
Copy link
Author

To try to explain easier, this is the model I'm used to with firebare to identify the user:

class _State extends State<> {
// var _isLoading = false;
final _auth = FirebaseAuth.instance;

void _x(
String
String
String
File
) async {
try {

  final ref = FirebaseStorage.instance
      .ref()
      .child('')
      .child(‘’);

  await ref.putFile(thumbnail).whenComplete(() => null);
  final url = await ref.getDownloadURL();
  await FirebaseFirestore.instance
      .collection('')
      .doc(_auth.currentUser.uid)
      .set({

,
});
} catch (err) {
print(err);

}

}

@dshukertjr
Copy link
Owner

Sorry for the late reply. I am moving to another location, and was busy with that.

In Supabase, you can get the user and user_id like this:

final user = supabase.auth.user();
final userId = user.id;

Is this what you were looking for?

Also, if you go to Supabase discussion page, you can ask any Supabase related questions and someone should be able to answer them in no time!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants