Skip to content

Commit

Permalink
Set eid on onesignal on user login
Browse files Browse the repository at this point in the history
  • Loading branch information
iAmWillShepherd committed Dec 1, 2022
1 parent 2e747f8 commit 0277752
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion lib/screens/auth/login_screen.dart
Original file line number Diff line number Diff line change
Expand Up @@ -48,10 +48,15 @@ class _LoginFormState extends State<LoginForm> {
try {
final email = _emailController.text;
final password = _passwordController.text;
await Supabase.instance.client.auth.signInWithPassword(
final authResponse =
await Supabase.instance.client.auth.signInWithPassword(
email: email,
password: password,
);
final id = authResponse.user?.id;
if (id != null) {
OneSignal.shared.setExternalUserId(id);
}
} catch (e) {
ScaffoldMessenger.of(context).showSnackBar(SnackBar(
content: Text(e.toString() ?? "Login failed"),
Expand Down

0 comments on commit 0277752

Please sign in to comment.