summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRandomChars <random@chars.jp>2021-09-06 23:32:55 +0900
committerRandomChars <random@chars.jp>2021-09-06 23:32:55 +0900
commitde238d0f46e4cfe51509dc9f8c930eab6106b7e5 (patch)
tree2799e1077b3caa288c8a3f8b8826425b7063c225
parent436ac328ea21f84fa00febeb4c488539c6d924cb (diff)
allow clearing secret in clientv1.1.1
-rw-r--r--client/remote.go6
1 files changed, 6 insertions, 0 deletions
diff --git a/client/remote.go b/client/remote.go
index 4f3248a..34a0684 100644
--- a/client/remote.go
+++ b/client/remote.go
@@ -52,6 +52,12 @@ func (r *Remote) Handshake() error {
// Secret authenticates and sets secret.
func (r *Remote) Secret(secret string) (api.UserPayload, bool) {
+ // Clear secret if empty
+ if secret == "" {
+ r.secret = secret
+ return api.UserPayload{}, true
+ }
+
prev := r.secret
r.secret = secret
if user, err := r.This(); err != nil {