update
This commit is contained in:
parent
f1db550ee7
commit
b2aeb642cc
11 changed files with 209 additions and 60 deletions
23
lib/auth/auth_service.dart
Normal file
23
lib/auth/auth_service.dart
Normal file
|
|
@ -0,0 +1,23 @@
|
|||
import 'package:supabase_flutter/supabase_flutter.dart';
|
||||
|
||||
class AuthService {
|
||||
final SupabaseClient _supabase = Supabase.instance.client;
|
||||
|
||||
Future<AuthResponse> signIn(String email, String password) async {
|
||||
return await _supabase.auth.signInWithPassword(email: email, password: password);
|
||||
}
|
||||
|
||||
Future<AuthResponse> signUp(String email, String password) async {
|
||||
return await _supabase.auth.signUp(email: email, password: password);
|
||||
}
|
||||
|
||||
Future<void> signOut() async {
|
||||
await _supabase.auth.signOut();
|
||||
}
|
||||
|
||||
String? getCurrentUser() {
|
||||
final session = _supabase.auth.currentSession;
|
||||
final user = session?.user;
|
||||
return user?.email;
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue