Commit 138500f0 authored by ale's avatar ale
Browse files

Remove some commented-out code

parent e4ef52dd
......@@ -113,31 +113,6 @@ type U2FRegistration struct {
Counter uint32 `json:"counter"`
}
// const (
// AuthResultOk = iota
// AuthResultFail
// AuthResultNeed2FA
// )
// type AuthResult int
// func (r AuthResult) String() string {
// switch r {
// case AuthResultOk:
// return "OK"
// case AuthResultFail:
// return "FAIL"
// case AuthResultNeed2FA:
// return "NEED_2FA"
// default:
// return "UNKNOWN"
// }
// }
// type Auhtenticator interface {
// Authenticate(string, string, string) AuthResult
// }
var saltEncoding *base64.Encoding
func init() {
......
......@@ -224,39 +224,3 @@ func (s *Service) Flash(r *http.Request, message string) {
session, _ := s.Store.Get(r, flashSessionName)
session.AddFlash(message)
}
type txnKeyType int
const txnKey txnKeyType = 1
// // TxnFromRequest returns the transaction associated with the request,
// // assuming that the caller is wrapped in a WithTransaction
// // invocation.
// func TxnFromRequest(r *http.Request) idp.Txn {
// s := r.Context().Value(txnKey)
// if s == nil {
// panic("transaction not registered for this request!")
// }
// return s.(idp.Txn)
// }
// // WithTransaction wraps the http Handler in a database transaction.
// func (s *Service) WithTransaction(h http.Handler) http.Handler {
// return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
// txn, err := s.db.NewTransaction(r.Context())
// if err != nil {
// log.Printf("database error: %v", err)
// http.Error(w, err.Error(), http.StatusInternalServerError)
// return
// }
// ctx := context.WithValue(r.Context(), txnKey, txn)
// h.ServeHTTP(w, r.WithContext(ctx))
// // Rollback the transaction if it hasn't been committed yet.
// if err := txn.Rollback(); err != nil {
// log.Printf("transaction rollback error: %v", err)
// //http.Error(w, err.Error(), http.StatusInternalServerError)
// }
// })
// }
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment