move auth feature from container to profile

This commit is contained in:
Fabian Freund
2026-02-12 10:25:44 +01:00
parent 9f7637dd06
commit 45f54ef092
28 changed files with 903 additions and 455 deletions
@@ -20,8 +20,8 @@
import 'package:riverpod_annotation/riverpod_annotation.dart';
import 'package:uuid/uuid.dart';
import 'package:weblibre/core/filesystem.dart';
import 'package:weblibre/domain/entities/profile.dart';
import 'package:weblibre/features/user/data/models/auth_settings.dart';
part 'profile.g.dart';
@@ -40,8 +40,11 @@ class ProfileRepository extends _$ProfileRepository {
await filesystem.setStartupProfile(UuidValue.withValidation(id));
}
Future<Profile> createProfile({required String name}) async {
final profile = Profile.create(name: name);
Future<Profile> createProfile({
required String name,
AuthSettings? authSettings,
}) async {
final profile = Profile.create(name: name, authSettings: authSettings);
if (!await filesystem.createNewProfile(profile)) {
throw Exception('Could not create profile');
}