MCPcopy
hub / github.com/writefreely/writefreely / configureOauthRoutes

Function configureOauthRoutes

oauth.go:309–321  ·  view source on GitHub ↗
(parentHandler *Handler, r *mux.Router, app *App, oauthClient oauthClient, callbackProxy *callbackProxyClient)

Source from the content-addressed store, hash-verified

307}
308
309func configureOauthRoutes(parentHandler *Handler, r *mux.Router, app *App, oauthClient oauthClient, callbackProxy *callbackProxyClient) {
310 handler := &oauthHandler{
311 Config: app.Config(),
312 DB: app.DB(),
313 Store: app.SessionStore(),
314 oauthClient: oauthClient,
315 EmailKey: app.keys.EmailKey,
316 callbackProxy: callbackProxy,
317 }
318 r.HandleFunc("/oauth/"+oauthClient.GetProvider(), parentHandler.OAuth(handler.viewOauthInit)).Methods("GET")
319 r.HandleFunc("/oauth/callback/"+oauthClient.GetProvider(), parentHandler.OAuth(handler.viewOauthCallback)).Methods("GET")
320 r.HandleFunc("/oauth/signup", parentHandler.OAuth(handler.viewOauthSignup)).Methods("POST")
321}
322
323func (h oauthHandler) viewOauthCallback(app *App, w http.ResponseWriter, r *http.Request) error {
324 ctx := r.Context()

Callers 5

configureSlackOauthFunction · 0.85
configureWriteAsOauthFunction · 0.85
configureGitlabOauthFunction · 0.85
configureGenericOauthFunction · 0.85
configureGiteaOauthFunction · 0.85

Calls 5

OAuthMethod · 0.80
ConfigMethod · 0.65
DBMethod · 0.65
SessionStoreMethod · 0.65
GetProviderMethod · 0.65

Tested by

no test coverage detected