| 59392 | errCb: i.newAuthErr, |
| 59393 | })) |
| 59394 | } |
| 59395 | class Oauth2 extends Re.Component { |
| 59396 | constructor(s, o) { |
| 59397 | super(s, o) |
| 59398 | let { name: i, schema: a, authorized: u, authSelectors: _ } = this.props, |
| 59399 | w = u && u.get(i), |
| 59400 | x = _.getConfigs() || {}, |
| 59401 | C = (w && w.get('username')) || '', |
| 59402 | j = (w && w.get('clientId')) || x.clientId || '', |
| 59403 | L = (w && w.get('clientSecret')) || x.clientSecret || '', |
| 59404 | B = (w && w.get('passwordType')) || 'basic', |
| 59405 | $ = (w && w.get('scopes')) || x.scopes || [] |
| 59406 | ;('string' == typeof $ && ($ = $.split(x.scopeSeparator || ' ')), |
| 59407 | (this.state = { |
| 59408 | appName: x.appName, |
| 59409 | name: i, |
| 59410 | schema: a, |
| 59411 | scopes: $, |
| 59412 | clientId: j, |
| 59413 | clientSecret: L, |
| 59414 | username: C, |
| 59415 | password: '', |
| 59416 | passwordType: B, |
| 59417 | })) |
| 59418 | } |
| 59419 | close = (s) => { |
| 59420 | s.preventDefault() |
| 59421 | let { authActions: o } = this.props |
| 59422 | o.showDefinitions(!1) |
| 59423 | } |
| 59424 | authorize = () => { |
| 59425 | let { |
| 59426 | authActions: s, |
| 59427 | errActions: o, |
| 59428 | getConfigs: i, |
| 59429 | authSelectors: a, |
| 59430 | oas3Selectors: u, |
| 59431 | } = this.props, |
| 59432 | _ = i(), |
| 59433 | w = a.getConfigs() |
| 59434 | ;(o.clear({ authId: name, type: 'auth', source: 'auth' }), |
| 59435 | oauth2_authorize_authorize({ |
| 59436 | auth: this.state, |
| 59437 | currentServer: u.serverEffectiveValue(u.selectedServer()), |
| 59438 | authActions: s, |
| 59439 | errActions: o, |
| 59440 | configs: _, |
| 59441 | authConfigs: w, |
| 59442 | })) |
| 59443 | } |
| 59444 | onScopeChange = (s) => { |
| 59445 | let { target: o } = s, |
| 59446 | { checked: i } = o, |
| 59447 | a = o.dataset.value |
| 59448 | if (i && -1 === this.state.scopes.indexOf(a)) { |
| 59449 | let s = this.state.scopes.concat([a]) |
| 59450 | this.setState({ scopes: s }) |
| 59451 | } else |
nothing calls this directly
no test coverage detected