Skip to content
This repository has been archived by the owner on Oct 4, 2024. It is now read-only.

Login with wallet though shell: command format #61

Merged
merged 5 commits into from
Jul 16, 2019

Conversation

janedegtiareva
Copy link
Contributor

No description provided.

Copy link
Contributor

@vgrichina vgrichina left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  1. Are there any corresponding wallet changes? Which branch?
  2. Is there a plan to offer user to login when executing other commands without having a valid key?

index.js Outdated Show resolved Hide resolved
bin/near Outdated
type: 'string',
default: 'https://wallet.nearprotocol.com',
})
.option('accountId', {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

shouldn't it be chosen from wallet UI?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We need to know accountId on the shell side, so it's either passing accountId to wallet and then failing if it can't be used, or setting up some callback mechanism to shell. 1st option seems much simpler

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

1st option isn't good UX for when you don't have any account yet.

It makes sense though as a shorthand to pre-select existing account in wallet.

@janedegtiareva
Copy link
Contributor Author

  1. Are there any corresponding wallet changes? Which branch?
    I haven't pushed it yet, but they are going to be basically cosmetic. (supporting not having successUrl + diff permissions)
  2. Is there a plan to offer user to login when executing other commands without having a valid key?
    Out of scope for this change, but it's a good user story to add to the backlog.

@vgrichina
Copy link
Contributor

  • Are there any corresponding wallet changes? Which branch?
    I haven't pushed it yet, but they are going to be basically cosmetic. (supporting not having successUrl + diff permissions)

Anyway it makes sense to review them together with this PR.

  • Is there a plan to offer user to login when executing other commands without having a valid key?
    Out of scope for this change, but it's a good user story to add to the backlog.

AFAIK we discussed this as a basic part of UX for the feature. Isn't a blocker for this PR, but is necessary to provide decent UX.

@janedegtiareva
Copy link
Contributor Author

added the prompt to enter account id. callback to shell would be a diff pr


exports.login = async function(options) {
if (!options.walletUrl) {
console.log("Log in is not needed on this environment. Please use appropriate master account for shell operations.")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is hard to understand for outsider. Probably makes sense to link to docs on how to run local setup.

newUrl.searchParams.set('title', title);
const keyPair = await KeyPair.fromRandom('ed25519');
newUrl.searchParams.set('public_key', keyPair.getPublicKey());
console.log(`Please navigate to this url and follow the insturctions to log in: ${newUrl.toString()}`);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

s/insturctions/instructions/

probably good idea to put newline before URL to make it easier to copy if not clickable in given terminal

@janedegtiareva janedegtiareva merged commit c586996 into nightshade Jul 16, 2019
@volovyks volovyks deleted the j-walletlogin branch October 19, 2021 13:40
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants