-
-
Notifications
You must be signed in to change notification settings - Fork 10.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
10 changed files
with
184 additions
and
86 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
68 changes: 0 additions & 68 deletions
68
ghost/core/core/frontend/services/assets-minification/AdminAuthAssets.js
This file was deleted.
Oops, something went wrong.
3 changes: 0 additions & 3 deletions
3
ghost/core/core/frontend/services/assets-minification/index.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,7 @@ | ||
const AdminAuthAssets = require('./AdminAuthAssets'); | ||
const CardAssets = require('./CardAssets'); | ||
|
||
const adminAuthAssets = new AdminAuthAssets(); | ||
const cardAssets = new CardAssets(); | ||
|
||
module.exports = { | ||
adminAuthAssets, | ||
cardAssets | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
35 changes: 35 additions & 0 deletions
35
ghost/core/core/server/web/admin/middleware/serve-auth-frame-file.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
const path = require('node:path'); | ||
const fs = require('node:fs/promises'); | ||
|
||
function createServeAuthFrameFileMw(config, urlUtils) { | ||
const placeholders = { | ||
'{{SITE_ORIGIN}}': new URL(urlUtils.getSiteUrl()).origin | ||
}; | ||
|
||
return function serveAuthFrameFileMw(req, res, next) { | ||
const filename = path.parse(req.url).base; | ||
|
||
let basePath = path.join(config.get('paths').publicFilePath, 'admin-auth'); | ||
let filePath; | ||
|
||
if (filename === '') { | ||
filePath = path.join(basePath, 'index.html'); | ||
} else { | ||
filePath = path.join(basePath, filename); | ||
} | ||
|
||
return fs.readFile(filePath).then((data) => { | ||
let dataString = data.toString(); | ||
|
||
for (const [key, value] of Object.entries(placeholders)) { | ||
dataString = dataString.replace(key, value); | ||
} | ||
|
||
res.end(dataString); | ||
}).catch(() => { | ||
return next(); | ||
}); | ||
}; | ||
} | ||
|
||
module.exports = createServeAuthFrameFileMw; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters