EmptyTempHandler adds an empty request token secret to the ctx if none is present to support OAuth1 providers which do not require temp secrets to be kept between the login phase and callback phase.
(success http.Handler)
| 98 | // present to support OAuth1 providers which do not require temp secrets to |
| 99 | // be kept between the login phase and callback phase. |
| 100 | func EmptyTempHandler(success http.Handler) http.Handler { |
| 101 | fn := func(w http.ResponseWriter, req *http.Request) { |
| 102 | ctx := req.Context() |
| 103 | _, _, err := RequestTokenFromContext(ctx) |
| 104 | if err != nil { |
| 105 | ctx = WithRequestToken(ctx, "", "") |
| 106 | } |
| 107 | success.ServeHTTP(w, req.WithContext(ctx)) |
| 108 | } |
| 109 | return http.HandlerFunc(fn) |
| 110 | } |
| 111 | |
| 112 | // CallbackHandler handles OAuth1 callback requests by parsing the oauth token |
| 113 | // and verifier, reading the request token secret from the ctx, then obtaining |
nothing calls this directly
no test coverage detected