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: Chess Mobile App with authentication #347

Open
wants to merge 42 commits into
base: main
Choose a base branch
from

Conversation

ofcljaved
Copy link
Contributor

This PR do this
https://youtu.be/-6WtZn5Zx0I

In order to have same backend for mobile and app, I added another callback which will capture the cookie and send it as query params for mobile and works exactly same for web

Full documentation is in README

Copy link
Collaborator

@siinghd siinghd left a comment

Choose a reason for hiding this comment

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

Have you tested this? does it work properly? can you provide any APK or testflight to test this?

import { db } from '../db';
import base64 from 'base-64';
Copy link
Collaborator

Choose a reason for hiding this comment

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

why not use JWT?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Can Use JWT also, but it'll be two times longer than base64 encode token and also it needs a secret too.
Can shift to JWT there's no problem

@@ -60,11 +63,29 @@ router.get(
router.get(
'/google/callback',
passport.authenticate('google', {
successRedirect: CLIENT_URL,
// successRedirect: CLIENT_URL,
Copy link
Collaborator

Choose a reason for hiding this comment

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

why we only comment this here and not on github or facebook too?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Only tested for google, I'll update it after testing for github and facebook

@ofcljaved
Copy link
Contributor Author

Have you tested this? does it work properly? can you provide any APK or testflight to test this?

Yess I have tested it, let me find a way to provide a APK to test this

Copy link
Contributor Author

@ofcljaved ofcljaved left a comment

Choose a reason for hiding this comment

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

Added github sign-in, not implemented facebook oauth as it has been removed

import { db } from '../db';
import base64 from 'base-64';
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Can Use JWT also, but it'll be two times longer than base64 encode token and also it needs a secret too.
Can shift to JWT there's no problem

@siinghd
Copy link
Collaborator

siinghd commented Jul 10, 2024

lets go with jwt... also send an apk please

@ofcljaved
Copy link
Contributor Author

lets go with jwt... also send an apk please

Ohk I'll shift to jwt, and regarding apk, I am figuring out why it's not working in production but working perfectly fine in development mode

@ofcljaved
Copy link
Contributor Author

@siinghd expo doesn't have jwt support as jwt requires node internal library crypto so I kept the base64 and made the apk
here's the link to download it
link to apk: https://expo.dev/accounts/chessrandom1233/projects/chess-mobile/builds/fefd8bbe-b65e-463d-82cf-f53f1bb4d9c2

For the time being I hosted web socket server and backend server to ec2 and postgres is running on neon db
You can download the apk for android mobile and play the game by signing in
For testing only did the google auth (github is working fine too just need to put env variables there)

@devsargam
Copy link

🎉 🎉 🎉

@siinghd
Copy link
Collaborator

siinghd commented Jul 30, 2024

@ofcljaved thank you will test it later

@ofcljaved
Copy link
Contributor Author

@hkirat
image

@devsargam
Copy link

Lol

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.

3 participants