(w http.ResponseWriter, r *http.Request)
| 102 | } |
| 103 | |
| 104 | func (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 | |
| 121 | func (a *API) linkIdentityToUser(r *http.Request, ctx context.Context, tx *storage.Connection, userData *provider.UserProvidedData, providerType string) (*models.User, error) { |
| 122 | targetUser := getTargetUser(ctx) |
nothing calls this directly
no test coverage detected