Skip to content
This repository was archived by the owner on Jun 27, 2019. It is now read-only.

Commit a19cb53

Browse files
committed
No provider check + authenticate only write access
as @appinteractive suggested
1 parent c4e5b24 commit a19cb53

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

server/services/usersettings/usersettings.hooks.js

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,24 +5,26 @@ const auth = require('@feathersjs/authentication');
55

66
module.exports = {
77
before: {
8-
all: [
9-
iff(isProvider('rest'), auth.hooks.authenticate('jwt'))
10-
],
8+
all: [],
119
find: [],
1210
get: [],
13-
create: [
11+
create: [
12+
auth.hooks.authenticate('jwt'),
1413
mapCreateToUpsert(context => {
1514
const { data } = context;
1615
return { userId: data.userId };
1716
})
1817
],
1918
update: [
19+
auth.hooks.authenticate('jwt'),
2020
restrictToOwner()
2121
],
2222
patch: [
23+
auth.hooks.authenticate('jwt'),
2324
restrictToOwner()
2425
],
2526
remove: [
27+
auth.hooks.authenticate('jwt'),
2628
restrictToOwner()
2729
]
2830
},

0 commit comments

Comments
 (0)