Skip to content

Commit ef725ec

Browse files
committed
fix web problems
1 parent 48412f5 commit ef725ec

File tree

3 files changed

+7
-2
lines changed

3 files changed

+7
-2
lines changed

internal/server/middlerwares.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,7 @@ func addCorsMiddleware(s fiber.Router) {
139139
allowedPaths := []string{
140140
routes.WellknownMytokenConfiguration,
141141
routes.WellknownOpenIDConfiguration,
142+
routes.GetGeneralPaths().JWKSEndpoint,
142143
}
143144
allowedPrefixes := []string{
144145
apiPath.Prefix,

internal/server/web/static/js/discovery.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ function discovery(...next) {
1717
}
1818
$.ajax({
1919
type: "Get",
20-
url: instanceURL + "/.well-known/mytoken-configuration",
20+
url: instanceURL + (instanceURL.endsWith("/") ? "" : "/") + ".well-known/mytoken-configuration",
2121
success: function (res) {
2222
configElements.forEach(function (el) {
2323
storageSet(el, res[el]);

internal/server/web/static/js/tokeninfo-status.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,12 @@ async function update_tokeninfo() {
4444
let mytokenIss = payload['iss'];
4545
$tokeninfoTypeBadges.hideB();
4646
$tokeninfoBadgeTypeJWTInvalid.showB();
47+
if (mytokenIss.endsWith("/")) {
48+
mytokenIss = mytokenIss.substring(0, mytokenIss.length - 1);
49+
}
4750
if (!mytokenIss.startsWith(window.location.href)) {
48-
await fetch(mytokenIss + "/.well-known/mytoken-configuration").then(function (res) {
51+
let url = mytokenIss + "/.well-known/mytoken-configuration";
52+
await fetch(url).then(function (res) {
4953
return res.json();
5054
}).then(function (data) {
5155
tokeninfoEndpoint = data['tokeninfo_endpoint'];

0 commit comments

Comments
 (0)