Skip to content

Commit

Permalink
refactor: rename sign JWT deep link
Browse files Browse the repository at this point in the history
  • Loading branch information
CedrikNikita committed Oct 14, 2024
1 parent d05aa96 commit fc44dbe
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions docs/deep-link-schema.md
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ https://wallet.superhero.com/sign-message?message=test&x-success=https%3A%2F%2Fe
## Sign a JWT

```bash
https://wallet.superhero.com/jwt-sign
https://wallet.superhero.com/sign-jwt
? payload=<payload>
& x-success=<success-url>
& x-cancel=<cancel-url>
Expand All @@ -105,5 +105,5 @@ https://wallet.superhero.com/jwt-sign
### Example

```
https://wallet.superhero.com/jwt-sign?payload=%7B%22test%22%3A1%7D&x-success=https%3A%2F%2Fexample.com%3Fsigned-payload%3D%7Bsigned-payload%7D&x-cancel=https%3A%2F%2Fexample.com%2Ffail-jwt-sign
https://wallet.superhero.com/sign-jwt?payload=%7B%22test%22%3A1%7D&x-success=https%3A%2F%2Fexample.com%3Fsigned-payload%3D%7Bsigned-payload%7D&x-cancel=https%3A%2F%2Fexample.com%2Ffail-sign-jwt
```
4 changes: 2 additions & 2 deletions src/popup/router/routes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -797,8 +797,8 @@ export const routes: WalletAppRouteConfig[] = [
},
},
{
name: 'jwt-sign',
path: '/jwt-sign',
name: 'sign-jwt',
path: '/sign-jwt',
component: JwtSign,
meta: {
title: 'signMessage',
Expand Down
4 changes: 2 additions & 2 deletions tests/e2e/integration/deeplinks.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ describe('Test cases for deeplinks', () => {
it.skip('JWT signing and verifying signature', () => {
cy.login(
{},
`/jwt-sign?payload=${encodedJWTPayload}`
`/sign-jwt?payload=${encodedJWTPayload}`
+ `&x-success=${encodedTestDeploymentUrl}%2Faccount%3F%7Bsigned-payload%7D`
+ `&x-cancel=${encodedTestDeploymentUrl}`,
)
Expand All @@ -147,7 +147,7 @@ describe('Test cases for deeplinks', () => {
});

it('JWT signing from superhero', () => {
cy.login({}, '/jwt-sign?payload=%7B%22a%22%3A1%2C%22b%22%3A2%7D&x-success=https%3A%2F%2Fchat.superhero.com&x-cancel=https%3A%2F%2Fchat.superhero.com')
cy.login({}, '/sign-jwt?payload=%7B%22a%22%3A1%2C%22b%22%3A2%7D&x-success=https%3A%2F%2Fchat.superhero.com&x-cancel=https%3A%2F%2Fchat.superhero.com')
.get('[data-cy=label]')
.eq(0)
.should('be.visible')
Expand Down
4 changes: 2 additions & 2 deletions tests/pages/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -45,10 +45,10 @@
`&x-success=${encodeURIComponent(`${currentUrl}?result=success&signature={signature}`)}` +
`&x-cancel=${cancelUrl}`,
`sign-transaction?transaction=${encodedTx}&networkId=ae_mainnet&${callbackParams}`,
`jwt-sign?payload=%7B%22a%22%3A1%2C%22b%22%3A2%7D` +
`sign-jwt?payload=%7B%22a%22%3A1%2C%22b%22%3A2%7D` +
`&x-success=${encodeURIComponent(`${currentUrl}?result=success&signed-payload={signed-payload}`)}` +
`&x-cancel=${cancelUrl}`,
`jwt-sign?payload=%7B%22a%22%3A1%2C%22b%22%3A2%7D&x-success=https%3A%2F%2Fchat.superhero.com/{signed-payload}&x-cancel=https%3A%2F%2Fchat.superhero.com`,
`sign-jwt?payload=%7B%22a%22%3A1%2C%22b%22%3A2%7D&x-success=https%3A%2F%2Fchat.superhero.com/{signed-payload}&x-cancel=https%3A%2F%2Fchat.superhero.com`,
`invite/Yqk76XDXNGVMZiCVfzE9NGHwhbXiCAsah2bxVpevCGjdLeeqPaSBVR4CkAdLyb1a7HGn2RD69RDLxYF3rdL3MWouvTyyK`,
`invite#PZK6m94Sc5X2ibggH4sFPnG98GGdhCMzbpbHju4jSWxpoD4uB`,
];
Expand Down

0 comments on commit fc44dbe

Please sign in to comment.