mirror of
https://github.com/jwinterm/modoboa.git
synced 2026-10-17 05:41:25 +02:00
Build redirect uri dynamically when needed.
It will allows compatibility with multi hostname envs.
This commit is contained in:
@@ -3,6 +3,6 @@
|
||||
"API_DOC_URL": "/api/schema-v2/swagger/",
|
||||
"OAUTH_AUTHORITY_URL": "https://localhost:8000/api/o",
|
||||
"OAUTH_CLIENT_ID": "LVQbfIIX3khWR3nDvix1u9yEGHZUxcx53bhJ7FlD",
|
||||
"OAUTH_REDIRECT_URI": "https://localhost:3000/login/logged",
|
||||
"OAUTH_REDIRECT_URI": "/login/logged",
|
||||
"OAUTH_POST_REDIRECT_URI": "https://localhost:3000/"
|
||||
}
|
||||
|
||||
@@ -17,10 +17,15 @@ export const useAuthStore = defineStore('auth', () => {
|
||||
const config = useGlobalConfig()
|
||||
const authUser = ref(null)
|
||||
const isAuthenticated = ref(false)
|
||||
let redirectUri = config.OAUTH_REDIRECT_URI
|
||||
|
||||
if (!redirectUri.startsWith('http')) {
|
||||
redirectUri = `${location.protocol}//${location.host}${redirectUri}`
|
||||
}
|
||||
const manager = new UserManager({
|
||||
authority: config.OAUTH_AUTHORITY_URL,
|
||||
client_id: config.OAUTH_CLIENT_ID,
|
||||
redirect_uri: config.OAUTH_REDIRECT_URI,
|
||||
redirect_uri: redirectUri,
|
||||
post_logout_redirect_uri: config.OAUTH_POST_REDIRECT_URI,
|
||||
response_type: 'code',
|
||||
scope: 'openid read write',
|
||||
|
||||
Reference in New Issue
Block a user