Skip to content

Commit

Permalink
Merge pull request #46 from kiwijos/auth
Browse files Browse the repository at this point in the history
Auth
  • Loading branch information
kiwijos authored Oct 5, 2023
2 parents 5d2bdc0 + 875bf62 commit 246571e
Show file tree
Hide file tree
Showing 7 changed files with 331 additions and 12 deletions.
194 changes: 186 additions & 8 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,13 @@
"author": "",
"license": "ISC",
"dependencies": {
"bcryptjs": "^2.4.3",
"body-parser": "^1.20.2",
"cors": "^2.8.5",
"dotenv": "^16.0.3",
"eventsource": "^2.0.2",
"express": "^4.14.0",
"jsonwebtoken": "^9.0.2",
"express-graphql": "^0.12.0",
"graphql": "^15.8.0",
"mongodb": "^6.0.0",
Expand Down
11 changes: 7 additions & 4 deletions src/config/app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ import { schema, resolver } from "./schema/index";
import delayed from "../routes/delayed";
import tickets from "../routes/tickets";
import codes from "../routes/codes";
import auth from "../routes/auth";
import jwtAuth from "../middleware/jwtAuth";

const app: Express = express();

Expand All @@ -18,6 +20,11 @@ app.disable("x-powered-by");
app.use(bodyParser.json()); // for parsing application/json
app.use(bodyParser.urlencoded({ extended: true })); // for parsing application/x-www-form-urlencoded

app.use("/delayed", jwtAuth.checkToken, delayed);
app.use("/tickets", jwtAuth.checkToken, tickets);
app.use("/codes", jwtAuth.checkToken, codes);
app.use("/auth", auth);

// Make handler a graphql handler
app.use(
"/graphql",
Expand All @@ -28,8 +35,4 @@ app.use(
})
);

app.use("/delayed", delayed);
app.use("/tickets", tickets);
app.use("/codes", codes);

export default app;
Loading

0 comments on commit 246571e

Please sign in to comment.