mirror of https://github.com/ghostfolio/ghostfolio
committed by
GitHub
4 changed files with 36 additions and 1 deletions
@ -0,0 +1,20 @@ |
|||
import { getOidcDiscoveryUrl } from './oidc.helper'; |
|||
|
|||
describe('getOidcDiscoveryUrl', () => { |
|||
it.each([ |
|||
[ |
|||
'https://auth.example.com', |
|||
'https://auth.example.com/.well-known/openid-configuration' |
|||
], |
|||
[ |
|||
'https://auth.example.com/', |
|||
'https://auth.example.com/.well-known/openid-configuration' |
|||
], |
|||
[ |
|||
'https://auth.example.com/application/o/ghostfolio/', |
|||
'https://auth.example.com/application/o/ghostfolio/.well-known/openid-configuration' |
|||
] |
|||
])('creates the discovery URL for %s', (issuer, expected) => { |
|||
expect(getOidcDiscoveryUrl(issuer)).toBe(expected); |
|||
}); |
|||
}); |
|||
@ -0,0 +1,4 @@ |
|||
export function getOidcDiscoveryUrl(issuer: string) { |
|||
// Remove trailing slashes
|
|||
return `${issuer.replace(/\/+$/, '')}/.well-known/openid-configuration`; |
|||
} |
|||
Loading…
Reference in new issue