diff options
| author | HJ <30-hj@users.noreply.git.pleroma.social> | 2024-01-13 23:44:06 +0000 |
|---|---|---|
| committer | HJ <30-hj@users.noreply.git.pleroma.social> | 2024-01-13 23:44:06 +0000 |
| commit | ae4e360157234a352f71c90e84b9861ee572472e (patch) | |
| tree | d3c83c6555cb83285adc0923a96dac0a9bf84d47 /src/modules | |
| parent | 9277a0cc0c85e6a9b9b6800f8769a868f8b355b5 (diff) | |
| parent | 209c0a83325b9475b5ff9a4fd1ebede17d06ed63 (diff) | |
Merge branch 'tusooa/registration-notice' into 'develop'
Show a dedicated registration notice page when further action is required after registering
See merge request pleroma/pleroma-fe!1851
Diffstat (limited to 'src/modules')
| -rw-r--r-- | src/modules/users.js | 21 |
1 files changed, 18 insertions, 3 deletions
diff --git a/src/modules/users.js b/src/modules/users.js index 6467d732..b8f49f15 100644 --- a/src/modules/users.js +++ b/src/modules/users.js @@ -250,6 +250,7 @@ export const mutations = { signUpPending (state) { state.signUpPending = true state.signUpErrors = [] + state.signUpNotice = {} }, signUpSuccess (state) { state.signUpPending = false @@ -257,6 +258,12 @@ export const mutations = { signUpFailure (state, errors) { state.signUpPending = false state.signUpErrors = errors + state.signUpNotice = {} + }, + signUpNotice (state, notice) { + state.signUpPending = false + state.signUpErrors = [] + state.signUpNotice = notice } } @@ -287,6 +294,7 @@ export const defaultState = { usersByNameObject: {}, signUpPending: false, signUpErrors: [], + signUpNotice: {}, relationships: {} } @@ -524,9 +532,16 @@ const users = { const data = await rootState.api.backendInteractor.register( { params: { ...userInfo } } ) - store.commit('signUpSuccess') - store.commit('setToken', data.access_token) - store.dispatch('loginUser', data.access_token) + + if (data.access_token) { + store.commit('signUpSuccess') + store.commit('setToken', data.access_token) + store.dispatch('loginUser', data.access_token) + return 'ok' + } else { // Request succeeded, but user cannot login yet. + store.commit('signUpNotice', data) + return 'request_sent' + } } catch (e) { const errors = e.message store.commit('signUpFailure', errors) |
