git.iko.soy/cinny-click-packaging
on main help sign in
Open SSO logins in morph
commit94bf575bf928707311358435e64cafe28f0cd2ef authorMarcel Alexandru Nitan <nitan.marcel@protonmail.com> dateMon 4 Apr 2022, 22:04 (5 years ago) parent5b78edd
2 files changed+40
patches/0010-Open-SSO-login-in-a-new-window.patch+25 qml/Main.qml+15
patches/0010-Open-SSO-login-in-a-new-window.patchnew file+25
@@ -0,0 +1,25 @@
1+From 6f942f835c6dd39054c2e37b7754f4a2bcb5b5b3 Mon Sep 17 00:00:00 2001
2+From: Marcel Alexandru Nitan <nitan.marcel@protonmail.com>
3+Date: Mon, 4 Apr 2022 22:03:21 +0300
4+Subject: [PATCH] Open SSO login in a new window
5+
6+---
7+ src/client/action/auth.js | 2 +-
8+ 1 file changed, 1 insertion(+), 1 deletion(-)
9+
10+diff --git a/src/client/action/auth.js b/src/client/action/auth.js
11+index f9be13b..f28cefb 100644
12+--- a/src/client/action/auth.js
13++++ b/src/client/action/auth.js
14+@@ -15,7 +15,7 @@ function createTemporaryClient(baseUrl) {
15+ async function startSsoLogin(baseUrl, type, idpId) {
16+ const client = createTemporaryClient(baseUrl);
17+ localStorage.setItem(cons.secretKey.BASE_URL, client.baseUrl);
18+- window.location.href = client.getSsoLoginUrl(window.location.href, type, idpId);
19++ window.open(client.getSsoLoginUrl("cinny://sso/", type, idpId));
20+ }
21+
22+ async function login(baseUrl, username, email, password) {
23+--
24+2.30.2
25+
qml/Main.qml+15
@@ -144,6 +144,21 @@ MainView {
144144 }
145145
146146 }
147+
148+ Connections {
149+ target: UriHandler
150+
151+ onOpened: {
152+ console.log('Open from UriHandler')
153+
154+ if (uris.length > 0) {
155+ if (uris[0].match(/^cinny:\/\/sso\/\?loginToken=.*/)) {
156+ webView.url = "http://localhost:19999/" + uris[0].replace("cinny://sso/", "");
157+ }
158+ }
159+ }
160+ }
161+
147162 WebChannel {
148163 id: channel
149164 registeredObjects: [webChannelObject]