Thanks to visit codestin.com
Credit goes to github.com

Skip to content
This repository was archived by the owner on Mar 9, 2021. It is now read-only.

Commit 7ca0ed2

Browse files
committed
Updated few files
1 parent d44699e commit 7ca0ed2

File tree

5 files changed

+11
-54
lines changed

5 files changed

+11
-54
lines changed

src/migrations/20191018165948-init.js

Lines changed: 0 additions & 23 deletions
This file was deleted.

src/resolvers/authentication/index.js

Lines changed: 8 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,14 @@
11
import passport from 'passport'
22

3-
import signUpUserLocal from './local'
4-
5-
const signUp = {
6-
local: signUpUserLocal
7-
}
3+
import './local'
4+
import './github'
85

96
export default (app) => {
10-
app.get(
11-
'/auth/:strategy',
12-
(req, res) => signUp[req.params.strategy](req, res)
13-
)
7+
app.get("/auth/:strategy", (req, res) =>
8+
passport.authenticate(req.params.strategy)(req, res)
9+
);
1410

15-
app.post(
16-
'/auth/:strategy/callback',
17-
(req, res) => passport.authenticate(
18-
req.params.strategy
19-
)(req, res)
20-
)
11+
app.post("/auth/:strategy/callback", (req, res) =>
12+
passport.authenticate(req.params.strategy)(req, res)
13+
);
2114
}

src/resolvers/authentication/local.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,5 +50,3 @@ const signUpUserLocal = (req, res) => {
5050
})
5151
res.redirect(`/auth/${strategy}`)
5252
}
53-
54-
export default signUpUserLocal

src/resolvers/authorization.js

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -11,17 +11,3 @@ export const isSelfDeleteAuth = combineResolvers(
1111
? skip
1212
: new ForbiddenError('Not authorized as admin.'),
1313
)
14-
15-
// export const isMessageOwner = async (
16-
// parent,
17-
// { id },
18-
// { models, me },
19-
// ) => {
20-
// const message = await models.Message.findByPk(id, { raw: true });
21-
22-
// if (message.userId !== me.id) {
23-
// throw new ForbiddenError('Not authenticated as owner.');
24-
// }
25-
26-
// return skip
27-
// }

schema.js renamed to src/schema/schema-old.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
// This is an old file. Can be useful.
2+
// This is currently not in use but don't delete until we have a fully working UserProfile backend
3+
14
import { gql } from 'apollo-server-express'
25

36
module.exports = gql`

0 commit comments

Comments
 (0)