feat(admin): grant full admin permissions in app and security rules to nicolas@gruber.info
Build Android APK / Build Release APKs (push) Successful in 16m30s

This commit is contained in:
2026-09-14 11:35:40 +02:00
parent f9a88a5ba2
commit 2f2170573d
4 changed files with 52 additions and 29 deletions
+9
View File
@@ -47,8 +47,17 @@ class AuthService extends ChangeNotifier {
_initAuth();
}
static const List<String> adminEmails = [
'nicolas@gruber.info',
];
Future<void> _checkAdminClaim(User? user) async {
if (user != null && !user.isAnonymous) {
final email = user.email?.trim().toLowerCase();
if (email != null && adminEmails.contains(email)) {
_isAdmin = true;
return;
}
try {
final tokenResult = await user.getIdTokenResult();
_isAdmin = tokenResult.claims?['admin'] == true;