Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Gladys Plus: Prepare socket.io upgrade + bug-fix on login when instance is not up #1637

Merged
merged 3 commits into from
Oct 31, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 17 additions & 17 deletions front/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion front/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
"postbuild-with-stats": "cp ./old-sw.js ./build/sw.js",
"serve": "sirv build --port 8080 --cors --single",
"dev": "preact watch -p 1444 --template src/template.html",
"start-gateway": "cross-env GATEWAY_MODE=true preact watch -p 1445 --template src/template.html",
"eslint": "eslint src cypress --ext .json --ext .js --ext .jsx",
"compare-translations": "comparejson -e ./src/config/i18n/*.json && node ./cli/check_translations.js",
"prettier-check": "prettier --check '**/*.js' '**/*.jsx' '**/*.json'",
Expand Down Expand Up @@ -43,7 +44,7 @@
"prettier": "^1.17.1"
},
"dependencies": {
"@gladysassistant/gladys-gateway-js": "^4.2.0",
"@gladysassistant/gladys-gateway-js": "^4.3.1",
"@gladysassistant/theme-optimized": "^1.0.3",
"@jaames/iro": "^5.5.2",
"@yaireo/tagify": "^4.5.0",
Expand Down
5 changes: 3 additions & 2 deletions front/src/actions/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -68,14 +68,15 @@ function createActions(store) {
const status = get(e, 'response.status');
const error = get(e, 'response.data.error');
const gatewayErrorMessage = get(e, 'response.data.error_message');
if (status === 401 || status === 403) {
const errorMessageOtherFormat = get(e, 'response.data.message');
if (status === 401) {
state.session.reset();
actions.redirectToLogin();
} else if (error === 'GATEWAY_USER_NOT_LINKED') {
route('/link-gateway-user');
} else if (error === 'USER_NOT_ACCEPTED_LOCALLY') {
route('/link-gateway-user');
} else if (gatewayErrorMessage === 'NO_INSTANCE_FOUND') {
} else if (gatewayErrorMessage === 'NO_INSTANCE_FOUND' || errorMessageOtherFormat === 'NO_INSTANCE_DETECTED') {
route('/link-gateway-user');
} else {
console.error(e);
Expand Down
2 changes: 1 addition & 1 deletion front/src/config/i18n/fr.json
Original file line number Diff line number Diff line change
Expand Up @@ -2167,7 +2167,7 @@
"gatewayLinkUser": {
"title": "Configurer Gladys Plus",
"label": "Sélectionnez votre utilisateur Gladys",
"description": "Avant de sélectionner votre utilisateur ici, vérifiez que celui-ci soit bien accepté locallement sur votre instance Gladys (dans \"Paramètres\" => \"Gladys Plus\" => \"Utilisateurs\").",
"description": "Avant de sélectionner votre utilisateur ici, vérifiez que celui-ci soit bien accepté localement sur votre instance Gladys (dans \"Paramètres\" => \"Gladys Plus\" => \"Utilisateurs\").",
"noInstanceFound": "Votre instance Gladys n'est pas connectée à la passerelle Gladys. Vous êtes-vous connecté à votre compte Gladys Plus dans votre installation Gladys ?",
"error": "Une erreur est survenue. Votre utilisateur est-il autorisé localement dans votre instance Gladys ?",
"saveButton": "Sauvegarder",
Expand Down