diff --git a/src/modules/auth/tests/auth.signup.view.unit.tests.js b/src/modules/auth/tests/auth.signup.view.unit.tests.js index a93f8e36c..1dd951c92 100644 --- a/src/modules/auth/tests/auth.signup.view.unit.tests.js +++ b/src/modules/auth/tests/auth.signup.view.unit.tests.js @@ -199,6 +199,32 @@ describe('auth.signup.view', () => { await flushPromises(); expect(wrapper.vm.signupError).toBe('Password too weak Email invalid'); }); + + it('shows the API error description (the precise reason in the error envelope)', async () => { + signupMock.mockRejectedValueOnce({ + response: { status: 403, data: { description: 'Registration is currently deactivated' } }, + }); + const wrapper = mountView(); + await flushPromises(); + wrapper.vm.email = 'john@example.com'; + wrapper.vm.password = 'password123'; + await wrapper.vm.validate(); + await flushPromises(); + expect(wrapper.vm.signupError).toBe('Registration is currently deactivated'); + }); + + it('prefers description over message when both are present', async () => { + signupMock.mockRejectedValueOnce({ + response: { status: 403, data: { message: 'Forbidden', description: 'Registration is currently deactivated' } }, + }); + const wrapper = mountView(); + await flushPromises(); + wrapper.vm.email = 'john@example.com'; + wrapper.vm.password = 'password123'; + await wrapper.vm.validate(); + await flushPromises(); + expect(wrapper.vm.signupError).toBe('Registration is currently deactivated'); + }); }); describe('password visibility toggle', () => { diff --git a/src/modules/auth/views/signup.view.vue b/src/modules/auth/views/signup.view.vue index 5af00748f..a5efc9217 100644 --- a/src/modules/auth/views/signup.view.vue +++ b/src/modules/auth/views/signup.view.vue @@ -362,6 +362,9 @@ export default { signupErrorMessage(error) { const data = error?.response?.data; if (typeof data === 'string' && data.trim()) return data; + // The API error envelope carries the precise reason in `description` + // (e.g. signup disabled) while `message` is often generic — prefer it. + if (typeof data?.description === 'string' && data.description.trim()) return data.description; if (typeof data?.message === 'string' && data.message.trim()) return data.message; if (typeof data?.error === 'string' && data.error.trim()) return data.error; if (Array.isArray(data?.errors) && data.errors.length > 0) { diff --git a/src/modules/organizations/components/organizations.members.component.vue b/src/modules/organizations/components/organizations.members.component.vue index c05eeb163..e178b9138 100644 --- a/src/modules/organizations/components/organizations.members.component.vue +++ b/src/modules/organizations/components/organizations.members.component.vue @@ -37,9 +37,22 @@ {{ item.role }} + +