Skip to content

Commit

Permalink
refactor: rename loginWithOTP to credentialToTokenLogin for clarity
Browse files Browse the repository at this point in the history
  • Loading branch information
adar2378 committed Sep 8, 2023
1 parent 2644e08 commit 5d83770
Showing 1 changed file with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -90,8 +90,9 @@ class AuthCubit extends HydratedCubit<AuthState> {
),
);

/// Login user with OTP. otp should not be empty
Future<void> loginWithOTP({
/// Authenticates the user based on provided credentials (e.g., username+password or email+OTP etc)
/// and logs them in by obtaining and processing a JWT token.
Future<void> credentialToTokenLogin({
required TokenObtainRequest tokenObtainRequest,
}) async =>
_authApiChecker(() async {
Expand Down Expand Up @@ -120,7 +121,7 @@ class AuthCubit extends HydratedCubit<AuthState> {
.decode(base64.decode(const Base64Codec().normalize(magiclink)))
.split('/');

await loginWithOTP(
await credentialToTokenLogin(
tokenObtainRequest: TokenObtainRequest(
email: credentials[0],
otp: credentials[1],
Expand Down

0 comments on commit 5d83770

Please sign in to comment.