currentUser function
- @Riverpod(keepAlive: true)
Exposes the current authenticated user (null when signed out).
Implementation
@Riverpod(keepAlive: true)
User? currentUser(Ref ref) {
final authState = ref.watch(authStateProvider);
return authState.whenOrNull(data: (state) => state.session?.user);
}