Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: saved user IP and added a check to verify it #1162

Closed
wants to merge 2 commits into from

Conversation

ItsFlash10
Copy link
Contributor

Resolves #1156

Checklist before requesting a review

  • I have performed a self-review of my code
  • I assure there is no similar/duplicate pull request regarding same issue

req.headers.get('x-forwarded-for') ||
req.ip ||
req.headers.get('x-real-ip');

if (!token) {
return NextResponse.redirect(new URL('/invalidsession', req.url));
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In this endpoint itself, send the ip and do the check there
Dont do it saparately below

Or

move all the logic for token check here as well

Dont have two saparate places for doing the check

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@hkirat done

@devsargam devsargam closed this Sep 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

bug: Store ips of the user in the db along with token, make sure token is valid for that ip
3 participants