Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/twofactor_gateway.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'js/service/registration.js')
-rw-r--r--js/service/registration.js11
1 files changed, 10 insertions, 1 deletions
diff --git a/js/service/registration.js b/js/service/registration.js
index 16a686c..d65c6a7 100644
--- a/js/service/registration.js
+++ b/js/service/registration.js
@@ -7,7 +7,16 @@ export function getState (gateway) {
return nc_fetch_json(url).then(function (resp) {
if (resp.ok) {
- return resp.json()
+ return resp.json().then(json => {
+ json.isAvailable = true
+ return json
+ })
+ }
+ if (resp.status === 503) {
+ console.info(gateway + ' gateway is not available')
+ return {
+ isAvailable: false
+ }
}
throw resp
})