No need for saferedirect on known connectors
Signed-off-by: Émile Ré <emile@getprobo.com>
This commit is contained in:
@@ -146,15 +146,7 @@ func NewMux(
|
|||||||
panic(fmt.Errorf("cannot initiate connector: %w", err))
|
panic(fmt.Errorf("cannot initiate connector: %w", err))
|
||||||
}
|
}
|
||||||
|
|
||||||
// Allow external redirects for OAuth providers
|
http.Redirect(w, r, redirectURL, http.StatusSeeOther)
|
||||||
var oauthSafeRedirect *saferedirect.SafeRedirect
|
|
||||||
switch provider {
|
|
||||||
case "SLACK":
|
|
||||||
oauthSafeRedirect = saferedirect.New(saferedirect.StaticHosts("slack.com"))
|
|
||||||
case "GOOGLE_WORKSPACE":
|
|
||||||
oauthSafeRedirect = saferedirect.New(saferedirect.StaticHosts("accounts.google.com"))
|
|
||||||
}
|
|
||||||
oauthSafeRedirect.Redirect(w, r, redirectURL, "/", http.StatusSeeOther)
|
|
||||||
})
|
})
|
||||||
|
|
||||||
r.Get("/connectors/complete", func(w http.ResponseWriter, r *http.Request) {
|
r.Get("/connectors/complete", func(w http.ResponseWriter, r *http.Request) {
|
||||||
|
|||||||
Reference in New Issue
Block a user