Trim files
This commit is contained in:
parent
864fcad631
commit
957a6c6c97
2 changed files with 23 additions and 27 deletions
18
lib/controllers/key_controller.dart
Normal file
18
lib/controllers/key_controller.dart
Normal file
|
@ -0,0 +1,18 @@
|
|||
import "dart:io";
|
||||
|
||||
import "package:dart_jsonwebtoken/dart_jsonwebtoken.dart";
|
||||
import "package:matrixoidc/controllers/settings_controller.dart";
|
||||
import "package:riverpod/riverpod.dart";
|
||||
|
||||
class KeyController extends AsyncNotifier<SecretKey> {
|
||||
@override
|
||||
Future<SecretKey> build() async => SecretKey(
|
||||
(await File.fromUri(
|
||||
Uri.file(ref.read(SettingsController.provider)!.jwtSecretFile),
|
||||
).readAsString()).trim(),
|
||||
);
|
||||
|
||||
static final provider = AsyncNotifierProvider<KeyController, SecretKey>(
|
||||
KeyController.new,
|
||||
);
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue