Shuffle/app/lib/features/auth/domain/email_link_request.dart
cschlaefke e632da2344 feat(auth): add registration, check-email and email-link screens
Implements KTO-01 criteria 1-4, 10 and 11 (client part).

Refs #1

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-03 00:27:16 +01:00

19 lines
676 B
Dart

import 'package:shuffle/features/auth/domain/email_link_type.dart';
/// Parameters of a mail link `/auth/confirm?token_hash=…&type=…`.
class EmailLinkRequest {
const EmailLinkRequest({required this.tokenHash, required this.type});
final String tokenHash;
final EmailLinkType type;
/// `null` if the token is missing or the type is unknown.
static EmailLinkRequest? tryParse(String? tokenHash, String? type) {
final parsedType = EmailLinkType.tryParse(type);
final token = tokenHash?.trim();
if (token == null || token.isEmpty || parsedType == null) {
return null;
}
return EmailLinkRequest(tokenHash: token, type: parsedType);
}
}