Skip to content

Commit

Permalink
ensure memo in challenge.go can be nil
Browse files Browse the repository at this point in the history
  • Loading branch information
JakeUrban committed Jan 25, 2023
1 parent aeff367 commit 4678d6b
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions exp/services/webauth/internal/serve/challenge.go
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ func (h challengeHandler) ServeHTTP(w http.ResponseWriter, r *http.Request) {
homeDomain = h.HomeDomains[0]
}

var memo txnbuild.MemoID
var memo *txnbuild.MemoID
memoParam := queryValues.Get("memo")
if memoParam != "" {
if isMuxedAccount {
Expand All @@ -72,7 +72,8 @@ func (h challengeHandler) ServeHTTP(w http.ResponseWriter, r *http.Request) {
badRequest.Render(w)
return
}
memo = txnbuild.MemoID(memoInt)
memoId := txnbuild.MemoID(memoInt)
memo = &memoId
}

tx, err := txnbuild.BuildChallengeTx(
Expand All @@ -82,7 +83,7 @@ func (h challengeHandler) ServeHTTP(w http.ResponseWriter, r *http.Request) {
homeDomain,
h.NetworkPassphrase,
h.ChallengeExpiresIn,
&memo,
memo,
)
if err != nil {
h.Logger.Ctx(ctx).WithStack(err).Error(err)
Expand Down

0 comments on commit 4678d6b

Please sign in to comment.