MCPcopy Create free account
hub / github.com/supabase/auth / LinkIdentity

Method LinkIdentity

internal/api/identity.go:104–119  ·  view source on GitHub ↗
(w http.ResponseWriter, r *http.Request)

Source from the content-addressed store, hash-verified

102}
103
104func (a *API) LinkIdentity(w http.ResponseWriter, r *http.Request) error {
105 ctx := r.Context()
106 user := getUser(ctx)
107 rurl, err := a.GetExternalProviderRedirectURL(w, r, user)
108 if err != nil {
109 return err
110 }
111 skipHTTPRedirect := r.URL.Query().Get("skip_http_redirect") == "true"
112 if skipHTTPRedirect {
113 return sendJSON(w, http.StatusOK, map[string]interface{}{
114 "url": rurl,
115 })
116 }
117 http.Redirect(w, r, rurl, http.StatusFound) // #nosec G710
118 return nil
119}
120
121func (a *API) linkIdentityToUser(r *http.Request, ctx context.Context, tx *storage.Connection, userData *provider.UserProvidedData, providerType string) (*models.User, error) {
122 targetUser := getTargetUser(ctx)

Callers

nothing calls this directly

Calls 4

getUserFunction · 0.85
sendJSONFunction · 0.85
GetMethod · 0.45

Tested by

no test coverage detected