Skip to content

Commit ae803a2

Browse files
committed
fix: add options for specifying login dialog content
1 parent 9e19037 commit ae803a2

File tree

5 files changed

+41
-6
lines changed

5 files changed

+41
-6
lines changed

.github/workflows/release-please.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,3 +11,4 @@ jobs:
1111
with:
1212
release-type: node
1313
package-name: release-please-action
14+
token: ${{ secrets.HYPHA_PAT_GITHUB_TOKEN }}

demo/public/hypha-logo.svg

Lines changed: 32 additions & 0 deletions
Loading

package-lock.json

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/HyphaAuthenticator.js

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -129,9 +129,9 @@ export class HyphaAuthenticator extends Authenticator {
129129
/**
130130
* Login using the Authenticator App. This can return one or more users depending on multiple chain support.
131131
*
132-
* @param accountName The account name of the user for Authenticators that do not store accounts (optional)
132+
* @param loginContent Options object with text content to display during login
133133
*/
134-
async login() {
134+
async login(loginContent = {}) {
135135
try {
136136
const loginCode = randomNumber();
137137
const action = generateAuthenticateAction({
@@ -143,7 +143,8 @@ export class HyphaAuthenticator extends Authenticator {
143143
const accountName = await this.transport.login(
144144
action,
145145
loginCode,
146-
this.loginContract
146+
this.loginContract,
147+
loginContent
147148
);
148149
if (accountName) {
149150
this.users = [new HyphaUser(this.transport, accountName)];
@@ -166,7 +167,7 @@ export class HyphaAuthenticator extends Authenticator {
166167
* Logs the user out of the dapp. This will be strongly dependent on each Authenticator app's patterns.
167168
*/
168169
logout() {
169-
this.users = []
170+
this.users = [];
170171
return this.transport.logout();
171172
}
172173

src/web-transport/index.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,11 +108,12 @@ class WebTransportLink {
108108
return transactionInfo;
109109
}
110110

111-
async login(actions, loginCode, loginContract) {
111+
async login(actions, loginCode, loginContract, loginContent = {}) {
112112
const options = {
113113
title: "Login",
114114
subtitle:
115115
"Scan the QR-code with Hypha Wallet or use the button to open a desktop wallet on this device.",
116+
...loginContent,
116117
};
117118

118119
const transactionInfo = await this.signTransaction({ actions }, options);

0 commit comments

Comments
 (0)