Added ability to set password for groups

• Added:
- ability to set password for groups
- GroupPasswordModal
- checks for if has password
- rate limiting in rack_attack
This commit is contained in:
mgabdev
2020-09-11 17:27:00 -05:00
parent 1baa123e25
commit 6d85c76c8f
13 changed files with 435 additions and 71 deletions

View File

@@ -9,6 +9,7 @@ import {
GROUP_EDITOR_RESET,
GROUP_EDITOR_SETUP,
GROUP_EDITOR_TITLE_CHANGE,
GROUP_EDITOR_PASSWORD_CHANGE,
GROUP_EDITOR_DESCRIPTION_CHANGE,
GROUP_EDITOR_COVER_IMAGE_CHANGE,
GROUP_EDITOR_ID_CHANGE,
@@ -24,6 +25,7 @@ const initialState = ImmutableMap({
isSubmitting: false,
isChanged: false,
title: '',
password: '',
description: '',
id: '',
tags: '',
@@ -48,6 +50,7 @@ export default function groupEditorReducer(state = initialState, action) {
return state.withMutations((map) => {
map.set('groupId', action.group.get('id'))
map.set('title', action.group.get('title'))
map.set('password', action.group.get('password'))
map.set('description', action.group.get('description'))
map.set('tags', tags)
map.set('isPrivate', action.group.get('is_private'))
@@ -66,6 +69,11 @@ export default function groupEditorReducer(state = initialState, action) {
map.set('description', action.description)
map.set('isChanged', true)
})
case GROUP_EDITOR_PASSWORD_CHANGE:
return state.withMutations((map) => {
map.set('password', action.password)
map.set('isChanged', true)
})
case GROUP_EDITOR_COVER_IMAGE_CHANGE:
return state.withMutations((map) => {
map.set('coverImage', action.value)