Skip to content
Snippets Groups Projects
Commit de238d0f authored by Ophestra's avatar Ophestra
Browse files

allow clearing secret in client

parent 436ac328
Branches
Tags v1.1.1
No related merge requests found
...@@ -52,6 +52,12 @@ func (r *Remote) Handshake() error { ...@@ -52,6 +52,12 @@ func (r *Remote) Handshake() error {
// Secret authenticates and sets secret. // Secret authenticates and sets secret.
func (r *Remote) Secret(secret string) (api.UserPayload, bool) { 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 prev := r.secret
r.secret = secret r.secret = secret
if user, err := r.This(); err != nil { if user, err := r.This(); err != nil {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment