benawad

graphql-express-template

Node.js GraphQL Server template

by benawad

JavaScript

JavaScript100%

Commit activity

Last 12 weeks · 0 commits

Full graph →

Community health

1 of 6 standards met

Community profile →
28
✓README○License○Contributing○Code of Conduct○Issue Template○PR Template

Recent PRs & issues

Quiet · 1 in progress · Last activity 5y ago
See all on GitHub →
dimple1024

In index.js at Line 29 of branch - https://github.com/benawad/graphql-express-template/tree/8_refresh_token: const addUser = async (req, res, next) => { const token = req.headers['x-token']; if (token) { try { const { user } = jwt.verify(token, SECRET); req.user = user; } catch (err) { const refreshToken = req.headers['x-refresh-token']; Here , consider a scenario if the tokens were compromised and one of them , lets say access token is now tampered , it will fail the verification and hence will enter the catch block and will generate a pair of new token. There should be an explicit check if the JWT verification fails and only if it is due to expiration of token then generate new pair of tokens.

dimple1024 · 5y ago
Javadebi

Hi Ben. I hope you are ok in these days. i have a tiny problem with my school project. I want to make a user , post, comment with Graphql ,Express and Mongoose(Mongodb). I have wrote some code but i don't know why its not working. Can you please do me a favor and help me? I can create user but when i want to create a post related to the user i get this error in playground: these are my codes: TypeDefs: Resolvers: UserSchema: PostSchema: CommentSchema:

Javadebi · 6y ago
dunatron

on L 33 of index.js you have logic like this if (!token) { return next(); } If the token were to expire in the client, the client will not send it along with the request meaning there is no token and refreshTokens would never be hit?

dunatron · 6y ago
TheFern2

Hey Ben I was just browsing github for express templates and noticed that you have a video list associated with the branches. A while ago I created a project to auto-generate markdown bullet points for the readme based on sequential branches by date. Just pasting here in case you want to give it a try. https://thefern2.github.io/generatrix/

TheFern2 · 5y ago
luckyvs1

Just around the 26:32 mark of your tutorial and I ran into the following error I have the models folder with the user.js and index.js file and outside in my project directory the index.js file has the following Do you have any suggestions on what I should be looking at to resolve this issue? Thanks

luckyvs1 · 8y ago
Structured data for AI agents

Repository: benawad/graphql-express-template. Description: Node.js GraphQL Server template Stars: 517, Forks: 191. Primary language: JavaScript. Languages: JavaScript (100%). Open PRs: 1, open issues: 3. Last activity: 5y ago. Community health: 28%. Top contributors: benawad.