fix(join-group): redirect unauthenticated users to login + docs update

- JoinGroupPage: redirect to login when user is not authenticated
- CLAUDE.md: add env details, path alias, and coding constraints

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
congsh
2026-06-18 13:53:38 +08:00
parent d76ecb15d6
commit 80dc45f528
2 changed files with 21 additions and 7 deletions
+9 -1
View File
@@ -19,7 +19,7 @@ const error = ref('')
const groupId = route.params.groupId as string
onMounted(async () => {
async function loadGroup() {
try {
group.value = await getGroup(groupId)
} catch {
@@ -27,6 +27,14 @@ onMounted(async () => {
} finally {
loading.value = false
}
}
onMounted(async () => {
if (!isAuthenticated()) {
router.replace({ name: 'Login', query: { redirect: route.fullPath } })
return
}
await loadGroup()
})
function goToLogin() {