예제 #1
0
func (v *CmdLogin) Run() error {
	cli, err := v.client()
	if err != nil {
		return err
	}
	v.sessionID, err = libkb.RandInt()
	if err != nil {
		return err
	}
	return cli.LoginWithPrompt(context.TODO(), keybase1.LoginWithPromptArg{
		SessionID: v.sessionID,
		Username:  v.Username,
	})
}
예제 #2
0
// RunClient runs the command in client/server mode.
func (c *CmdDeviceAdd) Run() error {
	var err error
	c.sessionID, err = libkb.RandInt()
	if err != nil {
		return err
	}
	cli, err := GetDeviceClient()
	if err != nil {
		return err
	}
	protocols := []rpc.Protocol{
		NewSecretUIProtocol(G),
		NewLocksmithUIProtocol(),
	}
	if err := RegisterProtocols(protocols); err != nil {
		return err
	}

	return cli.DeviceAdd(context.TODO(), keybase1.DeviceAddArg{SecretPhrase: c.phrase, SessionID: c.sessionID})
}