We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents fcf6963 + 55dde58 commit 51ea4f0Copy full SHA for 51ea4f0
src/auth-module/auth-module.actions.ts
@@ -3,6 +3,7 @@ eslint
3
@typescript-eslint/explicit-function-return-type: 0,
4
@typescript-eslint/no-explicit-any: 0
5
*/
6
+import fastCopy from 'fast-copy'
7
import { globalModels as models } from '../service-module/global-models'
8
import { getNameFromPath } from '../utils'
9
@@ -41,7 +42,8 @@ export default function makeAuthActions(feathersClient) {
41
42
.map(modelName => models[state.serverAlias][modelName])
43
.find(model => getNameFromPath(model.servicePath) === getNameFromPath(state.userService))
44
if (Model) {
- user = new Model(user)
45
+ // Copy user object to avoid setupInstance modifying payload state
46
+ user = new Model(fastCopy(user))
47
}
48
49
commit('setUser', user)
0 commit comments