SNS 계정 연결의 이메일 일치 조건 제거 — 현재 로그인과 새 제공자 인증을 서버에서 확인 · 다른 계정에 연결된 제공자는 거부 · 세션 만료 시 재로그인 안내

This commit is contained in:
Sn-Kinos
2026-10-10 21:14:49 +09:00
parent b66863a149
commit 4d2ce67886
8 changed files with 175 additions and 81 deletions
+15 -4
View File
@@ -109,20 +109,31 @@ void main() {
expect((outcome as AuthSucceeded).account.uid, 'u-1');
});
test('다른 이메일이면 E-AUTH-08 · 이메일 안내 문구', () async {
test('다른 계정에 붙은 카카오면 E-AUTH-08 · 세션 만료면 다시 로그인 안내', () async {
final auth = MockFirebaseAuth(
signedIn: true,
mockUser: MockUser(uid: 'u-1'),
);
final outcome = await kakao(
final inUse = await kakao(
auth,
serverError: FirebaseFunctionsException(
code: 'already-exists',
message: 'x',
details: {'code': 'E-AUTH-08', 'reason': 'different-email'},
details: {'code': 'E-AUTH-08'},
),
).link(auth.currentUser!);
expect((outcome as AuthFailed).code, 'E-AUTH-08');
expect((inUse as AuthFailed).code, 'E-AUTH-08');
expect(inUse.message, '다른 FANUZU 계정에 이미 연결된 소셜 계정입니다.');
final expired = await kakao(
auth,
serverError: FirebaseFunctionsException(
code: 'permission-denied',
message: 'x',
details: {'code': 'E-AUTH-03', 'reason': 'session'},
),
).link(auth.currentUser!);
expect((expired as AuthFailed).message, '보안을 위해 다시 로그인한 뒤 시도해 주세요.');
});
});
}