added guardian login with views for their assigned childs
This commit is contained in:
@@ -29,17 +29,12 @@ class AuthVerify extends MarianumConnectQuery {
|
||||
required String username,
|
||||
required String password,
|
||||
}) async {
|
||||
final token = await _tokenStorage.readToken();
|
||||
if (token == null || token.isEmpty) {
|
||||
throw AuthException.unauthorized(
|
||||
technicalDetails: 'AuthVerify: no bearer token in storage',
|
||||
);
|
||||
}
|
||||
final options = await _tokenStorage.requireBearerOptions('AuthVerify');
|
||||
return guard(() async {
|
||||
await dio.post<void>(
|
||||
endpoint('auth/verify'),
|
||||
data: {'username': username, 'password': password},
|
||||
options: Options(headers: {'Authorization': 'Bearer $token'}),
|
||||
options: options,
|
||||
);
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user