AmplicaLabs / wallet-proxy

Provides easy interface for DSNP over Frequency dApps to let Users sign in or sign up via supported wallets
https://amplicalabs.github.io/wallet-proxy
0 stars 0 forks source link

Login Open Window #50

Open enddynayn opened 10 months ago

enddynayn commented 10 months ago

Describe As a service provider, who wants to use proxy-wallet and does not want to redirect users to a new page, I want proxy-wallet to open with a pop-up window.

Acceptance Criteria

  1. When a service provider taps the login button in their app, a window opens showing the Proxy-Wallet. The URL parameters: RPC, schemas, and providerID are mandatory for this window.
  2. When the user finishes the sign-up process, the window is closed and the proxy wallet sends a message to the provider application. This message contains the delegation payload in registered submittable format, the signatures needed to create a handle and establish a sponsored account with delegation.

Architectural Notes This can be accomplished by sending messages between Proxy-Wallet and a service provider application. APS:

Additionally, establishing a handshake between parent and child window is important.

Child app

postMessage("PROXY:READY", "provider.app")

Service provider app

window.eventListener("message", (data) => {
  if (PROXY:READY) {
    ...
  }
})

Note This assumes a happy path. It does not consider closing the window early or logging in as a returning user. A different issue will address these cases.