mirror of
https://github.com/IT4Change/Ocelot-Social.git
synced 2025-12-13 07:45:56 +00:00
feat(webapp): redirect to group after registration with invite to group (#8540)
This commit is contained in:
parent
4e4eff8dc9
commit
d4a9694657
@ -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,
|
||||
|
||||
@ -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 },
|
||||
})
|
||||
|
||||
@ -5,6 +5,7 @@ export const validateInviteCode = () => gql`
|
||||
validateInviteCode(code: $code) {
|
||||
code
|
||||
invitedTo {
|
||||
slug
|
||||
groupType
|
||||
name
|
||||
about
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user