Skip to content

Commit dd24325

Browse files
committed
redirect to autologin
1 parent b86af95 commit dd24325

2 files changed

Lines changed: 19 additions & 19 deletions

File tree

frontend/bootloader.html

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -31,19 +31,7 @@
3131
/* End of Raw API */
3232
/* Data API */
3333
simplyDataApi = {
34-
// component/AppLauncher
35-
"appLocation" : async function(webID){
36-
let preferenceOLDM = await simplyDataApi.getPreferences(webID)
37-
if (
38-
preferenceOLDM.subjects[webID] &&
39-
preferenceOLDM.subjects[webID].solid$launcher
40-
) {
41-
return preferenceOLDM.subjects[webID].solid$launcher.id
42-
} else {
43-
return "https://solid-launcher.dev.muze.nl/"
44-
}
45-
},
46-
// component/AppLauncher
34+
// component/solid-preferences
4735
"getPreferences" : async function(webID){
4836

4937
let issuer = ""
@@ -90,7 +78,7 @@
9078
client_info: {
9179
client_name: 'Solid Bootloader',
9280
redirect_uris: [
93-
window.location.origin + window.location.pathname
81+
window.location.origin + window.location.pathname
9482
]
9583
},
9684
issuer: issuer
@@ -113,13 +101,25 @@
113101

114102
return preferenceOLDM
115103

104+
},
105+
// component/bootloader
106+
"appLocation" : async function(webID){
107+
let preferenceOLDM = await simplyDataApi.getPreferences(webID)
108+
if (
109+
preferenceOLDM.subjects[webID] &&
110+
preferenceOLDM.subjects[webID].solid$launcher
111+
) {
112+
return preferenceOLDM.subjects[webID].solid$launcher.id
113+
} else {
114+
return "https://solid-launcher.dev.muze.nl/"
115+
}
116116
}
117117
};
118118
/* End of Data API */
119119
simplyApp = simply.app({
120120
/* Actions */
121121
actions: {
122-
// component/AppLauncher
122+
// component/bootloader
123123
"getLauncherLocation" : async function (webID){
124124
let appLauncherPath = await simplyDataApi.appLocation(webID)
125125
return appLauncherPath
@@ -139,12 +139,12 @@
139139
/* Routes */
140140
routes: {
141141
// page/home
142-
"#webID/:webID" : async function(params) {
142+
"#autologin/:webID" : async function(params) {
143143
let webID = params.webID
144144
webID = decodeURIComponent(webID)
145145
localStorage['bootloader:webID'] = webID
146146
let appLauncherPath = await simplyApp.actions.getLauncherLocation(webID)
147-
document.location.href = appLauncherPath
147+
document.location.href = appLauncherPath + "#autologin/" + encodeURIComponent(webID)
148148
},
149149
// page/home
150150
"/" : async function() {
@@ -211,4 +211,4 @@
211211

212212
<!-- /Foot HTML -->
213213
</body>
214-
</html>
214+
</html>

lib/Routes/Account.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,7 @@ public static function respondToLogin() {
172172
Session::start($_POST['username']);
173173
$user = User::getUser($_POST['username']);
174174
if (!isset($_POST['redirect_uri']) || $_POST['redirect_uri'] === '') {
175-
header("Location: /dashboard/#webID/" . urlencode($user['webId']));
175+
header("Location: /dashboard/#autologin/" . urlencode($user['webId']));
176176
exit();
177177
}
178178
header("Location: " . urldecode($_POST['redirect_uri'])); // FIXME: Do we need to harden this?

0 commit comments

Comments
 (0)