feat(webapp): redirect to group after registration with invite to group (#8540)

This commit is contained in:
Moriz Wahl 2025-05-10 12:10:55 +02:00 committed by GitHub
parent 4e4eff8dc9
commit d4a9694657
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 13 additions and 1 deletions

View File

@ -514,6 +514,7 @@ export default shield(
},
Group: {
'*': isAuthenticated, // TODO - only those who are allowed to see the group
slug: allow,
avatar: allow,
name: allow,
about: allow,

View File

@ -269,7 +269,17 @@ export default {
setTimeout(async () => {
await this.$store.dispatch('auth/login', { email, password })
this.$toast.success(this.$t('login.success'))
this.$router.push('/')
const { validateInviteCode } = this.sliderData.sliders[0].data.response
if (
validateInviteCode &&
validateInviteCode.invitedTo &&
validateInviteCode.invitedTo.groupType === 'public'
) {
const { invitedTo } = validateInviteCode
this.$router.push(`/groups/${invitedTo.slug}`)
} else {
this.$router.push('/')
}
this.sliderData.setSliderValuesCallback(null, {
sliderSettings: { buttonLoading: false },
})

View File

@ -5,6 +5,7 @@ export const validateInviteCode = () => gql`
validateInviteCode(code: $code) {
code
invitedTo {
slug
groupType
name
about