Complete verification links and preserve verified login email (#60)
This commit is contained in:
1 parent
30f06c2f8f
commit
5f3b443e7b
25 files changed
+270
-32
No files matched your search
@@ -172,8 +172,10 @@ class BackendAuthServices
|
||||
|
||||
@override
|
||||
Future<VerificationResult> confirm({required String token}) async {
|
||||
await _post('verification/confirm', {'token': token}, verification: true);
|
||||
return VerificationMapper.fromDTO(const VerificationDTO(simulated: false));
|
||||
final dto = await _post('verification/confirm', {
|
||||
'token': token,
|
||||
}, verification: true);
|
||||
return BackendMapper.activation(dto);
|
||||
}
|
||||
|
||||
@override
|
||||
|
||||
@@ -19,11 +19,13 @@ class DummyVerificationService implements VerificationService, SimulationInfo {
|
||||
const DummyVerificationService({
|
||||
this.delay = const Duration(milliseconds: 600),
|
||||
this.sendFailure,
|
||||
this.verifiedEmail = 'alex@example.com',
|
||||
});
|
||||
@override
|
||||
bool get isSimulated => true;
|
||||
final Duration delay;
|
||||
final VerificationError? sendFailure;
|
||||
final String verifiedEmail;
|
||||
|
||||
@override
|
||||
Future<VerificationResult> send({
|
||||
@@ -41,7 +43,7 @@ class DummyVerificationService implements VerificationService, SimulationInfo {
|
||||
switch (token) {
|
||||
case 'demo-valid':
|
||||
return VerificationMapper.fromDTO(
|
||||
const VerificationDTO(simulated: true),
|
||||
VerificationDTO(simulated: true, email: verifiedEmail),
|
||||
);
|
||||
case 'demo-expired':
|
||||
throw const VerificationException(VerificationError.expired);
|
||||
|
||||
Reference in new issue
Block a user