Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions examples/demo-app/pages/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,9 @@ const chain = zksyncInMemoryNode;

const testTransferTarget = "0x55bE1B079b53962746B2e86d12f158a41DF294A6";
const zksyncConnectorWithSession = zksyncSsoConnector({
metadata: {
configData: { message: "Thanks for using the demo app with session support!" },
},
authServerUrl: "http://localhost:3002/confirm",
session: {
feeLimit: parseEther("0.1"),
Expand All @@ -80,6 +83,9 @@ const zksyncConnectorWithSession = zksyncSsoConnector({
});
const zksyncConnector = zksyncSsoConnector({
authServerUrl: "http://localhost:3002/confirm",
metadata: {
configData: { message: "Thanks for using the demo app!" },
},
});
const wagmiConfig = createConfig({
chains: [chain],
Expand Down
3 changes: 3 additions & 0 deletions packages/auth-server/components/session/Metadata.vue
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,9 @@
>
{{ domain }}
</p>
<div v-if="appMeta.configData && appMeta.configData['message']">
{{ appMeta.configData['message'] }}
</div>
</div>
</template>

Expand Down
1 change: 1 addition & 0 deletions packages/sdk/src/client-auth-server/Signer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,7 @@ export class Signer implements SignerInterface {
let metadata: AppMetadata = {
name: "Unknown DApp",
icon: null,
configData: {},
};
try {
metadata = this.getMetadata();
Expand Down
1 change: 1 addition & 0 deletions packages/sdk/src/client-auth-server/WalletProvider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ export class WalletProvider extends EventEmitter implements ProviderInterface {
metadata: () => ({
name: metadata?.name || getWebsiteName() || "Unknown DApp",
icon: metadata?.icon || getFavicon(),
configData: metadata?.configData || {},
}),
updateListener: this.updateListener,
communicator: communicator,
Expand Down
1 change: 1 addition & 0 deletions packages/sdk/src/client-auth-server/interface.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,4 +38,5 @@ export interface ProviderInterface extends EventEmitter {
export interface AppMetadata {
name: string;
icon: string | null;
configData: Record<string, string | number | boolean>;
}
1 change: 1 addition & 0 deletions packages/sdk/src/connector/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,7 @@ export const zksyncSsoConnector = (parameters: ZksyncSsoConnectorOptions) => {
metadata: {
name: parameters.metadata?.name,
icon: parameters.metadata?.icon,
configData: parameters.metadata?.configData,
},
authServerUrl: parameters.authServerUrl,
session: parameters.session,
Expand Down
Loading