| Conditions | 5 |
| Total Lines | 21 |
| Code Lines | 13 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | import {nc_fetch_json} from 'nextcloud_fetch'; |
||
| 3 | export function getState (gateway) { |
||
| 4 | let url = OC.generateUrl('/apps/twofactor_gateway/settings/{gateway}/verification', { |
||
|
|
|||
| 5 | gateway: gateway |
||
| 6 | }) |
||
| 7 | |||
| 8 | return nc_fetch_json(url).then(function (resp) { |
||
| 9 | if (resp.ok) { |
||
| 10 | return resp.json().then(json => { |
||
| 11 | json.isAvailable = true |
||
| 12 | return json |
||
| 13 | }) |
||
| 14 | } |
||
| 15 | if (resp.status === 503) { |
||
| 16 | console.info(gateway + ' gateway is not available') |
||
| 17 | return { |
||
| 18 | isAvailable: false |
||
| 19 | } |
||
| 20 | } |
||
| 21 | throw resp |
||
| 22 | }) |
||
| 23 | } |
||
| 24 | |||
| 75 |
This checks looks for references to variables that have not been declared. This is most likey a typographical error or a variable has been renamed.
To learn more about declaring variables in Javascript, see the MDN.