-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathdebug-config.html
More file actions
86 lines (77 loc) · 2.95 KB
/
debug-config.html
File metadata and controls
86 lines (77 loc) · 2.95 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Configuration Debug</title>
<style>
body {
font-family: monospace;
padding: 20px;
line-height: 1.6;
}
.config-section {
background: #f5f5f5;
padding: 15px;
margin: 10px 0;
border-radius: 5px;
}
.error {
color: red;
}
.success {
color: green;
}
</style>
</head>
<body>
<h1>Configuration Debug Information</h1>
<div class="config-section">
<h2>Environment Information</h2>
<p><strong>Current URL:</strong> <span id="current-url"></span></p>
<p><strong>Origin:</strong> <span id="origin"></span></p>
<p><strong>Pathname:</strong> <span id="pathname"></span></p>
<p><strong>NODE_ENV:</strong> <span id="node-env"></span></p>
</div>
<div class="config-section">
<h2>Expected Paths</h2>
<div id="expected-paths"></div>
</div>
<div class="config-section">
<h2>Configuration Values</h2>
<div id="config-values"></div>
</div>
<script>
// Display environment info
document.getElementById('current-url').textContent = window.location.href;
document.getElementById('origin').textContent = window.location.origin;
document.getElementById('pathname').textContent = window.location.pathname;
document.getElementById('node-env').textContent = process?.env?.NODE_ENV || 'undefined';
// Expected paths based on environment
const isProduction = process?.env?.NODE_ENV === 'production';
const basePath = isProduction ? "/multi-provider-authe" : "";
document.getElementById('expected-paths').innerHTML = `
<p><strong>Is Production:</strong> ${isProduction}</p>
<p><strong>Base Path:</strong> "${basePath}"</p>
<p><strong>Expected Landing:</strong> ${window.location.origin}${basePath}</p>
<p><strong>Expected Login:</strong> ${window.location.origin}${basePath}/login</p>
<p><strong>Expected Token:</strong> ${window.location.origin}${basePath}/token</p>
`;
// Try to access config if available
const config = {
cilogonRedirect: `${window.location.origin}${basePath}/auth/callback/cilogon`,
orcidRedirect: `${window.location.origin}${basePath}/auth/callback/orcid`
};
document.getElementById('config-values').innerHTML = `
<p><strong>CILogon Redirect URI:</strong> ${config.cilogonRedirect}</p>
<p><strong>ORCID Redirect URI:</strong> ${config.orcidRedirect}</p>
`;
console.log('Debug Config:', {
currentUrl: window.location.href,
isProduction,
basePath,
config
});
</script>
</body>
</html>