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/mobile auth #772

Closed
wants to merge 4 commits into from
Closed

Feat/mobile auth #772

wants to merge 4 commits into from

Conversation

nimit9
Copy link
Contributor

@nimit9 nimit9 commented Jun 6, 2024

PR Fixes:

  • 1 Added api routes for mobile login and logout
  • 2 Modified middleware.ts to authorize mobile routes

Resolves #761

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

@nimit9 nimit9 marked this pull request as draft June 6, 2024 18:55
@nimit9
Copy link
Contributor Author

nimit9 commented Jun 6, 2024

@hkirat Will be testing this thoroughly, and then mark it ready for review. We're disabling auth on local, so need to modify some code to test properly

src/middleware.ts Outdated Show resolved Hide resolved
src/middleware.ts Outdated Show resolved Hide resolved
@nimit9 nimit9 requested a review from siinghd June 17, 2024 19:33
if (token) {
try {
const payload: any = await verifyJWT(token);
request.nextUrl.searchParams.set('userId', payload.id);
Copy link
Collaborator

Choose a reason for hiding this comment

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

why can't be this used in logout?

src/app/api/auth/mobile/logout/route.ts Show resolved Hide resolved
@@ -3,26 +3,22 @@ import db from '@/db';

export async function POST(request: NextRequest) {
try {
// TODO: Get userid from somewhere not body
Copy link
Collaborator

Choose a reason for hiding this comment

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

lets wait for this to be solved

@siinghd
Copy link
Collaborator

siinghd commented Jul 10, 2024

@nimit9 any update on this? would like to close and merge

@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.

feature: Move auth to be jwt only
3 participants