Skip to content

Commit

Permalink
authenticate: fix branding for webauthn device registration page (#3572)
Browse files Browse the repository at this point in the history
  • Loading branch information
calebdoxsey committed Aug 24, 2022
1 parent ce818b3 commit e9e52d8
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
1 change: 1 addition & 0 deletions authenticate/handlers.go
Original file line number Diff line number Diff line change
Expand Up @@ -744,6 +744,7 @@ func (a *Authenticate) getWebauthnState(ctx context.Context) (*webauthn.State, e
SessionState: ss,
SessionStore: state.sessionStore,
RelyingParty: state.webauthnRelyingParty,
BrandingOptions: a.options.Load().BrandingOptions,
}, nil
}

Expand Down
7 changes: 5 additions & 2 deletions authenticate/handlers/webauthn/webauthn.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ type State struct {
SessionState *sessions.State
SessionStore sessions.SessionStore
SharedKey []byte
BrandingOptions httputil.BrandingOptions
}

// A StateProvider provides state for the handler.
Expand Down Expand Up @@ -398,11 +399,13 @@ func (h *Handler) handleView(w http.ResponseWriter, r *http.Request, state *Stat
return err
}

return ui.ServePage(w, r, "WebAuthnRegistration", map[string]interface{}{
m := map[string]interface{}{
"creationOptions": creationOptions,
"requestOptions": requestOptions,
"selfUrl": r.URL.String(),
})
}
httputil.AddBrandingOptionsToMap(m, state.BrandingOptions)
return ui.ServePage(w, r, "WebAuthnRegistration", m)
}

func (h *Handler) saveSessionAndRedirect(w http.ResponseWriter, r *http.Request, state *State, rawRedirectURI string) error {
Expand Down

0 comments on commit e9e52d8

Please sign in to comment.