Skip to content

Commit

Permalink
fix typo and remove confusing From from verification
Browse files Browse the repository at this point in the history
fix #38
  • Loading branch information
umputun committed Oct 21, 2019
1 parent 886247f commit 1eaca42
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions provider/verify.go
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ func (e VerifyHandler) Name() string { return e.ProviderName }
// In case if confirmation token presented in the query uses it to create auth token
func (e VerifyHandler) LoginHandler(w http.ResponseWriter, r *http.Request) {

// GET /login?site=site&&user=name&address=someone@example.com
// GET /login?site=site&user=name&address=someone@example.com
tkn := r.URL.Query().Get("token")
if tkn == "" { // no token, ask confirmation via email
e.sendConfirmation(w, r)
Expand Down Expand Up @@ -130,7 +130,7 @@ func (e VerifyHandler) LoginHandler(w http.ResponseWriter, r *http.Request) {
rest.RenderJSON(w, r, claims.User)
}

// GET /login?site=site&&user=name&address=someone@example.com
// GET /login?site=site&user=name&address=someone@example.com
func (e VerifyHandler) sendConfirmation(w http.ResponseWriter, r *http.Request) {
user, address := r.URL.Query().Get("user"), r.URL.Query().Get("address")
if user == "" || address == "" {
Expand All @@ -140,7 +140,6 @@ func (e VerifyHandler) sendConfirmation(w http.ResponseWriter, r *http.Request)
claims := token.Claims{
Handshake: &token.Handshake{
State: "",
From: r.URL.Query().Get("from"),
ID: user + "::" + address,
},
SessionOnly: r.URL.Query().Get("session") != "" && r.URL.Query().Get("session") != "0",
Expand Down

0 comments on commit 1eaca42

Please sign in to comment.