fix(gateway): hide Kakao notice for special access

This commit is contained in:
2026-08-12 15:43:01 +00:00
parent 0450cb518e
commit 683f7f2815
2 changed files with 68 additions and 4 deletions
@@ -28,7 +28,16 @@ const fulfillTrpc = async (route: Route, results: unknown[]): Promise<void> => {
type LobbyFixtureOptions = { type LobbyFixtureOptions = {
authenticated?: boolean; authenticated?: boolean;
roles?: string[];
kakaoVerified?: boolean;
canCreateGeneral?: boolean; canCreateGeneral?: boolean;
requiresKakaoVerification?: boolean;
specialAccess?: {
kind: 'OPERATOR' | 'TESTER' | 'RECOVERY' | 'OTHER';
grantId: string | null;
expiresAt: string | null;
allowsGeneralCreation: boolean;
} | null;
myGeneral?: { myGeneral?: {
name: string; name: string;
picture: string; picture: string;
@@ -48,7 +57,11 @@ type LobbyFixtureOptions = {
const installFixture = async (page: Page, options: LobbyFixtureOptions = {}) => { const installFixture = async (page: Page, options: LobbyFixtureOptions = {}) => {
const { const {
authenticated = true, authenticated = true,
roles = ['user'],
kakaoVerified = true,
canCreateGeneral = true, canCreateGeneral = true,
requiresKakaoVerification = false,
specialAccess = null,
myGeneral = { myGeneral = {
name: '선택장수', name: '선택장수',
picture: 'users/core2026/account-hash.png', picture: 'users/core2026/account-hash.png',
@@ -79,8 +92,8 @@ const installFixture = async (page: Page, options: LobbyFixtureOptions = {}) =>
id: 'lobby-user', id: 'lobby-user',
username: 'lobby-user', username: 'lobby-user',
displayName: '로비사용자', displayName: '로비사용자',
roles: ['user'], roles,
kakaoVerified: true, kakaoVerified,
createdAt: '2026-07-30T00:00:00.000Z', createdAt: '2026-07-30T00:00:00.000Z',
} }
: null : null
@@ -109,8 +122,9 @@ const installFixture = async (page: Page, options: LobbyFixtureOptions = {}) =>
localAccountPolicy: { localAccountPolicy: {
accessAllowed: true, accessAllowed: true,
canCreateGeneral, canCreateGeneral,
requiresKakaoVerification: false, requiresKakaoVerification,
graceEndsAt: null, graceEndsAt: null,
specialAccess,
}, },
}, },
]); ]);
@@ -216,6 +230,51 @@ test('applies the signed general-acquisition policy to both create and possessio
await expect(row.getByRole('button', { name: '장수빙의' })).toBeDisabled(); await expect(row.getByRole('button', { name: '장수빙의' })).toBeDisabled();
}); });
test('shows the Kakao verification banner when a profile still requires verification', async ({ page }) => {
await installFixture(page, {
kakaoVerified: false,
requiresKakaoVerification: true,
});
await page.goto('lobby');
await expect(page.getByText('카카오 인증이 필요합니다.')).toBeVisible();
});
test('hides the Kakao verification banner for operator special access', async ({ page }) => {
await installFixture(page, {
roles: ['superuser'],
kakaoVerified: false,
specialAccess: {
kind: 'OPERATOR',
grantId: null,
expiresAt: null,
allowsGeneralCreation: true,
},
});
await page.goto('lobby');
await expect(page.getByText('특수 접근 · OPERATOR')).toBeVisible();
await expect(page.getByText('카카오 인증이 필요합니다.')).toHaveCount(0);
});
test('hides the Kakao verification banner when a grant removes the remaining verification requirement', async ({
page,
}) => {
await installFixture(page, {
kakaoVerified: false,
specialAccess: {
kind: 'RECOVERY',
grantId: '11111111-1111-4111-8111-111111111111',
expiresAt: '2026-08-20T00:00:00.000Z',
allowsGeneralCreation: true,
},
});
await page.goto('lobby');
await expect(page.getByText('특수 접근 · RECOVERY')).toBeVisible();
await expect(page.getByText('카카오 인증이 필요합니다.')).toHaveCount(0);
});
test('opens the profile root without profile or game token query parameters', async ({ page }) => { test('opens the profile root without profile or game token query parameters', async ({ page }) => {
await installFixture(page); await installFixture(page);
await page.route('**/hwe/', async (route) => { await page.route('**/hwe/', async (route) => {
+6 -1
View File
@@ -46,7 +46,12 @@ const canAccessAdmin = computed(
role === 'superuser' || role === 'admin' || role === 'admin.superuser' || role.startsWith('admin.') role === 'superuser' || role === 'admin' || role === 'admin.superuser' || role.startsWith('admin.')
) ?? false ) ?? false
); );
const needsKakaoVerification = computed(() => me.value !== null && !me.value.kakaoVerified); const needsKakaoVerification = computed(
() =>
me.value !== null &&
!me.value.kakaoVerified &&
profiles.value.some((profile) => profile.localAccountPolicy?.requiresKakaoVerification === true)
);
const userIconBaseUrl = configuredUserIconPublicUrl(); const userIconBaseUrl = configuredUserIconPublicUrl();
const sharedIconBaseUrl = configuredSharedIconPublicUrl(); const sharedIconBaseUrl = configuredSharedIconPublicUrl();
const publicMapProfiles = computed(() => const publicMapProfiles = computed(() =>