(route string, handle func(email string, rw http.ResponseWriter, r *http.Request))
| 1544 | } |
| 1545 | |
| 1546 | func (o *ExternalAuthConfigOptions) AddRoute(route string, handle func(email string, rw http.ResponseWriter, r *http.Request)) *ExternalAuthConfigOptions { |
| 1547 | if route == "/" || route == "" || route == "/user" { |
| 1548 | panic("cannot override the /user route. Use ValidatePayload instead") |
| 1549 | } |
| 1550 | if !strings.HasPrefix(route, "/") { |
| 1551 | route = "/" + route |
| 1552 | } |
| 1553 | if o.routes == nil { |
| 1554 | o.routes = make(map[string]func(email string, rw http.ResponseWriter, r *http.Request)) |
| 1555 | } |
| 1556 | o.routes[route] = handle |
| 1557 | return o |
| 1558 | } |
| 1559 | |
| 1560 | // ExternalAuthConfig is the config for external auth providers. |
| 1561 | func (f *FakeIDP) ExternalAuthConfig(t testing.TB, id string, custom *ExternalAuthConfigOptions, opts ...func(cfg *externalauth.Config)) *externalauth.Config { |
no outgoing calls