mirror of
https://github.com/AppFlowy-IO/AppFlowy.git
synced 2025-07-24 09:26:49 +00:00

* chore: reload folder * chore: reload folder * chore: init sync * chore: update tables * chore: update database * chore: load row * chore: update * chore: reload row * test: fit test * chore: retry * chore: support batch fetch * chore: enable sync * chore: sync switch * chore: sync switch * chore: migration user data * chore: migrate data * chore: migrate folder * chore: save user email * chore: refresh user profile * chore: fix test * chore: delete translation files * test: clippy format
51 lines
1.5 KiB
Dart
51 lines
1.5 KiB
Dart
import 'package:appflowy_backend/protobuf/flowy-error/errors.pb.dart';
|
|
import 'package:appflowy_backend/protobuf/flowy-user/auth.pb.dart';
|
|
import 'package:appflowy_backend/protobuf/flowy-user/user_profile.pbserver.dart';
|
|
import 'package:dartz/dartz.dart';
|
|
|
|
class AuthServiceMapKeys {
|
|
const AuthServiceMapKeys._();
|
|
|
|
// for supabase auth use only.
|
|
static const String uuid = 'uuid';
|
|
static const String email = 'email';
|
|
}
|
|
|
|
abstract class AuthService {
|
|
/// Returns [UserProfilePB] if the user is authenticated, otherwise returns [FlowyError].
|
|
Future<Either<FlowyError, UserProfilePB>> signIn({
|
|
required String email,
|
|
required String password,
|
|
AuthTypePB authType,
|
|
Map<String, String> map,
|
|
});
|
|
|
|
/// Returns [UserProfilePB] if the user is authenticated, otherwise returns [FlowyError].
|
|
Future<Either<FlowyError, UserProfilePB>> signUp({
|
|
required String name,
|
|
required String email,
|
|
required String password,
|
|
AuthTypePB authType,
|
|
Map<String, String> map,
|
|
});
|
|
|
|
///
|
|
Future<Either<FlowyError, UserProfilePB>> signUpWithOAuth({
|
|
required String platform,
|
|
AuthTypePB authType,
|
|
Map<String, String> map,
|
|
});
|
|
|
|
/// Returns a default [UserProfilePB]
|
|
Future<Either<FlowyError, UserProfilePB>> signUpAsGuest({
|
|
AuthTypePB authType,
|
|
Map<String, String> map,
|
|
});
|
|
|
|
///
|
|
Future<void> signOut();
|
|
|
|
/// Returns [UserProfilePB] if the user has sign in, otherwise returns null.
|
|
Future<Either<FlowyError, UserProfilePB>> getUser();
|
|
}
|