GitShow/benawad/graphql-express-template
benawad

graphql-express-template

Node.js GraphQL Server template

by benawad
Star on GitHubForknpm

JavaScript

517 stars191 forks1 contributorQuiet · 5y agoSince 2017

Meet the team

See all 1 on GitHub →
benawad
benawad6 contributions

Languages

View on GitHub →
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
Refresh Token being issued even if the Access Token/Refresh Token is tampered and fails to get verifiedOpenIssue

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
My problem sorry!OpenIssue

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
Once expired code will not reach refreshTokensOpenIssue

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

Recent fixes

View closed PRs →
TheFern2
Readme list auto-generated ClosedIssue

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
jakec-dev
Why is token passed in as an argument in the refreshTokens method?ClosedIssue

Sorry if this is a stupid question but it's not used anywhere in the method so why is it added as the first arg?

jakec-dev · 7y ago
luckyvs1
[Question] Cannot find module ./modelsClosedIssue

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.

·@ofershap

Replace github.com with gitshow.dev