Skip to content

Commit

Permalink
url encode (#21)
Browse files Browse the repository at this point in the history
  • Loading branch information
ahmeroxa authored May 4, 2020
1 parent 85fa8c1 commit 7a21456
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
6 changes: 3 additions & 3 deletions cmd/auth.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,12 @@ package cmd
import (
"bytes"
"context"
b64 "encoding/base64"
"encoding/json"
"errors"
"fmt"
"io/ioutil"
"net/http"
"net/url"
"os"
"regexp"
"strings"
Expand Down Expand Up @@ -270,11 +270,11 @@ func signup(username, password, email string) error {
Timeout: 5 * time.Second,
}

b64Password := b64.StdEncoding.EncodeToString([]byte(password))
escapedPassword := url.QueryEscape(password)

requestBody, err := json.Marshal(map[string]string{
"username": username,
"password": b64Password,
"password": escapedPassword,
"email": email,
})
if err != nil {
Expand Down
5 changes: 2 additions & 3 deletions vendor/github.com/meroxa/meroxa-go/meroxa.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 7a21456

Please sign in to comment.