mirror of
https://github.com/linux-odyssey/linux-odyssey.git
synced 2026-11-06 03:20:13 +08:00
fix: add baseUrl in passport oauth
This commit is contained in:
1 parent
a69f4960b2
commit
33582a4827
6 files changed
+10
-3
No files matched your search
@@ -43,7 +43,7 @@ export default enabled
|
||||
{
|
||||
clientID: config.google.clientID,
|
||||
clientSecret: config.google.clientSecret,
|
||||
callbackURL: '/api/v1/auth/google/callback',
|
||||
callbackURL: `${config.baseUrl}/api/v1/auth/google/callback`,
|
||||
scope: ['profile', 'email'],
|
||||
},
|
||||
verify
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { get } from './utils/env.js'
|
||||
|
||||
export default {
|
||||
const config = {
|
||||
host: get('HOST', 'localhost'),
|
||||
port: get('PORT', 3000),
|
||||
db: get('MONGO_URL', 'mongodb://localhost:27017/odyssey-test'),
|
||||
@@ -15,3 +15,7 @@ export default {
|
||||
clientSecret: get('GOOGLE_CLIENT_SECRET', ''),
|
||||
},
|
||||
}
|
||||
|
||||
config.baseUrl = get('BASE_URL', `http://${config.host}:${config.port}`)
|
||||
|
||||
export default config
|
||||
+1
-1
@@ -49,7 +49,7 @@ async function main() {
|
||||
app.use('/api/v1', apiRouter)
|
||||
|
||||
server.listen(config.port, config.host, () => {
|
||||
console.log(`Server listening at http://${config.host}:${config.port}`)
|
||||
console.log(`Server listening at ${config.baseUrl}`)
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user