1212 :type =" alertType"
1313 >
1414 {{ alertMessage }}
15+ <v-row class =" mx-0 mt-3 justify-end" >
16+ <v-btn v-if =" errorCode === 400 && !!alertMessage.length" outlined @click =" handleResend" >
17+ {{ $t('authorisation.invitationAccept.resend') }}
18+ </v-btn >
19+ </v-row >
1520 </v-alert >
1621
1722 <k-field-group language-prefix =" authorisation.fields" >
5459</template >
5560
5661<script lang="js">
57- import { acceptInvitation } from ' @/api/endpoints/authorisation/register.js' ;
62+ import { acceptInvitation , resendInvitation } from ' @/api/endpoints/authorisation/register.js' ;
5863import { getRateLimitMinutes } from ' @/api/util/response.js' ;
5964import KFieldGroup from ' @/components/crud/fields/KFieldGroup.vue' ;
6065import KTextField from ' @/components/crud/fields/KTextField.vue' ;
@@ -68,13 +73,16 @@ export default {
6873 },
6974 data () {
7075 return {
76+ errorCode: 0 ,
7177 alertType: ' success' ,
7278 alertMessage: ' ' ,
7379 isLoading: false ,
80+ isValid: false ,
81+
7482 email: this .$route .query .email ,
7583 password: ' ' ,
7684 passwordConfirmation: ' ' ,
77- isValid : false ,
85+ organisation : this . $route . query . organisation ,
7886 };
7987 },
8088 computed: {
@@ -99,6 +107,10 @@ export default {
99107 }
100108 },
101109 methods: {
110+ async handleResend () {
111+ await resendInvitation (this .organisation , this .email );
112+ this .$router .push ({name: ' login' , query: {message: ' resendInvitationSuccess' }});
113+ },
102114 handleAccept () {
103115 this .isLoading = true ;
104116 acceptInvitation (this .email , this .$route .params .token , this .password , this .passwordConfirmation )
@@ -111,6 +123,7 @@ export default {
111123 const { response } = error;
112124 const { status } = response;
113125
126+ this .errorCode = status;
114127 if (status === 429 ) {
115128 this .alertMessage = this .$t (' errors.429' , { minutes: getRateLimitMinutes (response) });
116129 } else if (status === 400 ) {
0 commit comments