Skip to content

Commit

Permalink
Add support for perms param for create_account
Browse files Browse the repository at this point in the history
  • Loading branch information
brugeman committed Feb 28, 2024
1 parent 6b7b48c commit 7020943
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -1128,14 +1128,14 @@ class CreateAccountHandlingStrategy {
const token = getCreateAccountToken();

// params
const [name = "", domain = ""] = params;
const [name = "", domain = "", email = "", perms = ""] = params;

if (domain !== BUNKER_DOMAIN) throw new Error("Bad domain");

const appNpub = nip19.npubEncode(remotePubkey);

// format auth url
const url = `${BUNKER_ORIGIN}/create?name=${name}&token=${token}&appNpub=${appNpub}`;
const url = `${BUNKER_ORIGIN}/create?name=${name}&token=${token}&appNpub=${appNpub}&perms=${perms}&email=${email}`;
console.log("sending auth_url", url, "to", remotePubkey);
await backend.rpc.sendResponse(
id,
Expand Down
2 changes: 2 additions & 0 deletions src/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -222,6 +222,8 @@ if (process.argv.length >= 3) {
const params = [
"test",
"nsec.app",
"",
"sign_event:4"
// email?
];
ndk
Expand Down

0 comments on commit 7020943

Please sign in to comment.