feat: Deeplink login for Mobile and Desktop clients

Merged
YA
5mo ago
+194-25

Proposed changes (including videos or screenshots)

This is to log the user into mobile and desktop clients through web.

To achieve this we implement a new parameter loginClient to keep the info, where the login req was initiated.

We want that users can log into other clients i.e desktop and mobile through web, so idea was to implement a query param on url to contain this info and this info will be shared between server and clients through this url.

Now we can have a few cases and each of this hooks deals with these cases -

  • we only want to log into the web client itself - useLoginViaQuery

  • we want to log the user into some client through web, here we can have 2 cases. When the user is taken to web to initiate login -

  • Either user is already logged in web and we want to share same session to the client - useShareSessionWithOtherClients

  • User is not logged in, so user will have to perform login and then log into client - useLoginOtherClient

Issue(s)

Steps to test or reproduce

Further comments

PRM-30
PRM-31
PRM-32
PRM-33

Summary by CodeRabbit

  • New Features
    • Cross-client auth: web can open deep links to trigger login on desktop/mobile.
    • Session sharing: web can share stored session with native clients to streamline sign-in.
    • Desktop integration: shows a single “Login on web” button when running in the desktop app.
  • Enhanced OAuth
    • Preserves login-client context across OAuth flows and improves post-login redirects.
  • Type Updates
    • Added types to support desktop integration and desktop API access.

Review Change Stack