1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/element_ynh.git synced 2024-09-03 18:36:08 +02:00

Fix issue #11 SSO auth brocken

This commit is contained in:
Josué Tille 2018-07-25 22:55:25 +02:00
parent c6442dfe01
commit 5bed08895d
2 changed files with 5 additions and 1 deletions

View file

@ -49,6 +49,9 @@ install_source() {
a=${a//'*'/'\*'}
}
# We get the name of the Lifecycle objet
Lifecycle_object_name=$(egrep -o "onLoggedIn:\w+\.setLoggedIn," bundle.js $final_path/bundles/*/bundle.js | egrep -o ":\w+\." | egrep -o "\w")
# We get the part witch we need to patch and create a regular expression
a='case"start_login":this.setStateForNewView({view:unnamed_object.LOGIN}),this.notifyNewScreen("login");break;'
escape_string
@ -58,6 +61,7 @@ install_source() {
a="$(cat ../sources/bundle_patch.js)"
escape_string
a="${a//'unnamed_object'/'\1'}"
a="${a//'Lifecycle'/$Lifecycle_object_name}"
a="$(echo "$a" | sed -r "s|//.*||g")"
replace_string="$(echo $a)"
sed --in-place -r "s|$match_string|$replace_string|g" $final_path/bundles/*/bundle.js

View file

@ -11,7 +11,7 @@ case "start_login":
console.log(this.response);
if ((xhr.status == '200') && this.response.accessToken) {
H.setLoggedIn(this.response);
Lifecycle.setLoggedIn(this.response);
thisobject.setStateForNewView({
view: unnamed_object.LOGGING_IN
});