refactor(auth): remove username fallback
This commit is contained in:
@@ -76,7 +76,7 @@ export class AuthRepository implements IAuthRepository {
|
|||||||
LoginRequest.from(
|
LoginRequest.from(
|
||||||
withTestAccountFlag({
|
withTestAccountFlag({
|
||||||
email,
|
email,
|
||||||
username: resolveLoginUsername(input.username, email),
|
username: input.username,
|
||||||
password: input.password,
|
password: input.password,
|
||||||
platform: getAuthPlatform(),
|
platform: getAuthPlatform(),
|
||||||
guestId: input.guestId ?? "",
|
guestId: input.guestId ?? "",
|
||||||
@@ -341,11 +341,3 @@ function withTestAccountFlag<T extends Record<string, unknown>>(
|
|||||||
function getAuthPlatform(): string {
|
function getAuthPlatform(): string {
|
||||||
return PlatformDetector.getPlatform();
|
return PlatformDetector.getPlatform();
|
||||||
}
|
}
|
||||||
|
|
||||||
function resolveLoginUsername(
|
|
||||||
username: string | undefined,
|
|
||||||
email: string,
|
|
||||||
): string {
|
|
||||||
const trimmedUsername = username?.trim() ?? "";
|
|
||||||
return trimmedUsername.length > 0 ? trimmedUsername : email;
|
|
||||||
}
|
|
||||||
|
|||||||
Reference in New Issue
Block a user