1+ import 'package:ht_api/src/services/auth_token_service.dart' ;
2+ import 'package:ht_api/src/services/verification_code_storage_service.dart' ;
13import 'package:ht_data_repository/ht_data_repository.dart' ;
24import 'package:ht_email_repository/ht_email_repository.dart' ;
35import 'package:ht_shared/ht_shared.dart' ;
46import 'package:uuid/uuid.dart' ;
57
6- import 'package:ht_api/src/services/auth_token_service.dart' ;
7- import 'package:ht_api/src/services/verification_code_storage_service.dart' ;
8-
98/// {@template auth_service}
109/// Service responsible for orchestrating authentication logic on the backend.
1110///
@@ -82,7 +81,8 @@ class AuthService {
8281 // Consider distinguishing between expired and simply incorrect codes
8382 // For now, treat both as invalid input.
8483 throw const InvalidInputException (
85- 'Invalid or expired verification code.' ,);
84+ 'Invalid or expired verification code.' ,
85+ );
8686 }
8787
8888 // 2. Find or create the user
@@ -112,7 +112,8 @@ class AuthService {
112112 } on HtHttpException catch (e) {
113113 print ('Error finding/creating user for $email : $e ' );
114114 throw const OperationFailedException (
115- 'Failed to find or create user account.' ,);
115+ 'Failed to find or create user account.' ,
116+ );
116117 } catch (e) {
117118 print ('Unexpected error during user lookup/creation for $email : $e ' );
118119 throw const OperationFailedException ('Failed to process user account.' );
@@ -126,7 +127,8 @@ class AuthService {
126127 } catch (e) {
127128 print ('Error generating token for user ${user .id }: $e ' );
128129 throw const OperationFailedException (
129- 'Failed to generate authentication token.' ,);
130+ 'Failed to generate authentication token.' ,
131+ );
130132 }
131133 }
132134
@@ -152,7 +154,8 @@ class AuthService {
152154 } catch (e) {
153155 print ('Unexpected error during anonymous user creation: $e ' );
154156 throw const OperationFailedException (
155- 'Failed to process anonymous sign-in.' ,);
157+ 'Failed to process anonymous sign-in.' ,
158+ );
156159 }
157160
158161 // 2. Generate token
@@ -163,7 +166,8 @@ class AuthService {
163166 } catch (e) {
164167 print ('Error generating token for anonymous user ${user .id }: $e ' );
165168 throw const OperationFailedException (
166- 'Failed to generate authentication token.' ,);
169+ 'Failed to generate authentication token.' ,
170+ );
167171 }
168172 }
169173
0 commit comments