MCPcopy Index your code
hub / github.com/coder/coder / OAuth2

Function OAuth2

coderd/httpmw/oauth2.go:31–37  ·  view source on GitHub ↗

OAuth2 returns the state from an oauth request.

(r *http.Request)

Source from the content-addressed store, hash-verified

29
30// OAuth2 returns the state from an oauth request.
31func OAuth2(r *http.Request) OAuth2State {
32 oauth, ok := r.Context().Value(oauth2StateKey{}).(OAuth2State)
33 if !ok {
34 panic("developer error: oauth middleware not provided")
35 }
36 return oauth
37}
38
39// ExtractOAuth2 is a middleware for automatically redirecting to OAuth
40// URLs, and handling the exchange inbound. Any route that does not have

Callers 4

externalAuthCallbackMethod · 0.92
userOAuth2GithubMethod · 0.92
userOIDCMethod · 0.92
TestOAuth2Function · 0.92

Calls 2

ContextMethod · 0.65
ValueMethod · 0.45

Tested by 1

TestOAuth2Function · 0.74