feat: add local signup and Kakao verification gate

This commit is contained in:
2026-07-26 10:17:16 +00:00
parent c364552960
commit a7bb352ba2
41 changed files with 2293 additions and 95 deletions
@@ -4,6 +4,7 @@ import { useRoute, useRouter } from 'vue-router';
import DefaultLayout from '../layouts/DefaultLayout.vue';
import { trpc } from '../utils/trpc';
import { sealPassword } from '../utils/passwordEnvelope';
const route = useRoute();
const router = useRouter();
@@ -19,6 +20,7 @@ const confirmPassword = ref('');
const displayName = ref('');
const termsAgreed = ref(false);
const privacyAgreed = ref(false);
const thirdPartyUse = ref(false);
const appBase = import.meta.env.BASE_URL;
const completeExchange = async (): Promise<void> => {
@@ -36,6 +38,11 @@ const completeExchange = async (): Promise<void> => {
await router.replace('/lobby');
return;
}
if (result.status === 'verified') {
window.localStorage.setItem('sammo-session-token', result.sessionToken);
await router.replace('/lobby?verified=1');
return;
}
if (result.status === 'change_pw') {
infoMessage.value = '카카오톡으로 임시 비밀번호를 보냈습니다.';
return;
@@ -61,11 +68,15 @@ const register = async (): Promise<void> => {
}
submitting.value = true;
try {
const credential = await sealPassword(password.value);
const result = await trpc.auth.register.mutate({
oauthSessionId: oauthSessionId.value,
username: username.value,
password: password.value,
displayName: displayName.value || undefined,
credential,
displayName: displayName.value,
termsAgreed: true,
privacyAgreed: true,
thirdPartyUse: thirdPartyUse.value,
});
window.localStorage.setItem('sammo-session-token', result.sessionToken);
await router.replace('/lobby');
@@ -127,6 +138,13 @@ onMounted(() => {
<a :href="`${appBase}terms.2.html`" target="_blank">내용 확인</a> 동의합니다.
</label>
</div>
<div class="agreement-row">
<span>개인정보 제3자 제공 (선택)</span>
<label>
<input v-model="thirdPartyUse" type="checkbox" />
동의합니다.
</label>
</div>
<button class="register-button" type="submit" :disabled="submitting">
{{ submitting ? '가입 중...' : '가입' }}
</button>