Skip to content

Commit e432900

Browse files
authored
Merge pull request #872 from solid/fix/safari-login
Make login work on Safari
2 parents 4f3a008 + f4540d3 commit e432900

File tree

5 files changed

+13
-14
lines changed

5 files changed

+13
-14
lines changed

lib/api/authn/webid-oidc.js

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -90,14 +90,12 @@ function middleware (oidc) {
9090

9191
// Static assets related to authentication
9292
const authAssets = [
93+
['/.well-known/solid/login/', '../static/popup-redirect.html', false],
9394
['/common/', 'solid-auth-client/dist-popup/popup.html'],
9495
['/common/js/', 'solid-auth-client/dist-lib/solid-auth-client.bundle.js'],
9596
['/common/js/', 'solid-auth-client/dist-lib/solid-auth-client.bundle.js.map']
9697
]
97-
authAssets.map(([path, file]) => routeResolvedFile(router, path, file))
98-
// Redirect for .well-known login popup location
99-
router.get('/.well-known/solid/login',
100-
(req, res) => res.redirect('/common/popup.html'))
98+
authAssets.map(args => routeResolvedFile(router, ...args))
10199

102100
// Initialize the OIDC Identity Provider routes/api
103101
// router.get('/.well-known/openid-configuration', discover.bind(provider))

lib/utils.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -234,8 +234,8 @@ function reqToPath (req) {
234234
/**
235235
* Adds a route that serves a static file from another Node module
236236
*/
237-
function routeResolvedFile (router, path, file) {
238-
const fullPath = path + file.match(/[^/]+$/)
237+
function routeResolvedFile (router, path, file, appendFileName = true) {
238+
const fullPath = appendFileName ? path + file.match(/[^/]+$/) : path
239239
const fullFile = require.resolve(file)
240240
router.get(fullPath, (req, res) => res.sendFile(fullFile))
241241
}

package-lock.json

Lines changed: 6 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@
6161
"ip-range-check": "0.0.2",
6262
"is-ip": "^2.0.0",
6363
"li": "^1.0.1",
64-
"mashlib": "^0.7.14",
64+
"mashlib": "^0.7.15",
6565
"mime-types": "^2.1.11",
6666
"negotiator": "^0.6.0",
6767
"node-fetch": "^2.1.2",
@@ -72,7 +72,7 @@
7272
"rdflib": "^0.17.1",
7373
"recursive-readdir": "^2.1.0",
7474
"rimraf": "^2.5.0",
75-
"solid-auth-client": "^2.2.8",
75+
"solid-auth-client": "^2.2.9",
7676
"solid-namespace": "^0.1.0",
7777
"solid-permissions": "^0.6.0",
7878
"solid-ws": "^0.2.3",

static/popup-redirect.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
<script>location.replace(`/common/popup.html${location.hash}`)</script>

0 commit comments

Comments
 (0)