Skip to content

Commit

Permalink
Fix tenant gathering
Browse files Browse the repository at this point in the history
  • Loading branch information
ryandberger committed May 29, 2024
1 parent 03717a8 commit 4e6ffaa
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/components/AuthnLogin/AuthnLogin.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ const AuthnLogin = ({ stripes }) => {

if (okapi.authnUrl) {
if (config.isSingleTenant) {
const defaultTenant = Object.entries(tenantOptions)[0];
const defaultTenant = Object.values(tenantOptions)[0];
const redirectUri = `${window.location.protocol}//${window.location.host}/oidc-landing`;
const authnUri = `${okapi.authnUrl}/realms/${defaultTenant.name}/protocol/openid-connect/auth?client_id=${defaultTenant.clientId}&response_type=code&redirect_uri=${redirectUri}&scope=openid`;
return <Redirect to={authnUri} />;
Expand Down
2 changes: 1 addition & 1 deletion src/components/OIDCLanding.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ const OIDCLanding = () => {
const otp = getOtp();

if (otp) {
const defaultTenant = Object.entries(tenantOptions)[0];
const defaultTenant = Object.values(tenantOptions)[0];

setPotp(otp);
fetch(`${okapi.url}/authn/token?code=${otp}&redirect-uri=${window.location.protocol}//${window.location.host}/oidc-landing`, {
Expand Down
2 changes: 1 addition & 1 deletion src/components/PreLoginLanding/PreLoginLanding.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ function PreLoginLanding({ onSelectTenant }) {
const getLoginUrl = () => {
if (options.length < 1) return '';

const defaultTenant = Object.entries(tenantOptions)[0];
const defaultTenant = Object.values(tenantOptions)[0];

if (okapi.authnUrl) {
return `${okapi.authnUrl}/realms/${defaultTenant.name}/protocol/openid-connect/auth?client_id=${defaultTenant.clientId}&response_type=code&redirect_uri=${redirectUri}&scope=openid&isConsortium=true`;
Expand Down

0 comments on commit 4e6ffaa

Please sign in to comment.