Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion app/controllers/api/v1/api_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ def config_sorting(allowed_columns: [])
{ sort_column => sort_direction }
end

# Checks if external authentication is enabled
# Checks if external authentication is enabled (currently only OIDC is implemented)
def external_authn_enabled?
ENV['OPENID_CONNECT_ISSUER'].present?
end
Expand Down
2 changes: 1 addition & 1 deletion app/controllers/api/v1/env_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ class EnvController < ApiController
# Returns basic NON-CONFIDENTIAL information on the environment variables
def index
render_data data: {
OPENID_CONNECT: ENV['OPENID_CONNECT_ISSUER'].present?,
EXTERNAL_AUTH: ENV['OPENID_CONNECT_ISSUER'].present?, # currently only OIDC is implemented
HCAPTCHA_KEY: ENV.fetch('HCAPTCHA_SITE_KEY', nil),
VERSION_TAG: ENV.fetch('VERSION_TAG', ''),
CURRENT_PROVIDER: current_provider,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ export default function ManageUsers() {
/>
)}
{
(!envAPI.isLoading && !envAPI.data?.OPENID_CONNECT)
(!envAPI.isLoading && !envAPI.data?.EXTERNAL_AUTH)
&& (
<Modal
modalButton={
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ export default function Registration() {
</Dropdown.Item>
</SettingSelect>

{ env?.OPENID_CONNECT && (
{ env?.EXTERNAL_AUTH && (
<Row className="mb-3">
<SettingsRow
name="ResyncOnLogin"
Expand Down
2 changes: 1 addition & 1 deletion app/javascript/components/home/AuthButtons.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ export default function AuthButtons({ direction }) {
return registrationMethod !== 'invite' || !!inviteToken;
}

if (env?.OPENID_CONNECT) {
if (env?.EXTERNAL_AUTH) {
return (
<Form action={process.env.OMNIAUTH_PATH} method="POST" data-turbo="false">
<input type="hidden" name="authenticity_token" value={document.querySelector('meta[name="csrf-token"]').content} />
Expand Down
2 changes: 1 addition & 1 deletion app/javascript/components/rooms/room/join/JoinCard.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,7 @@ export default function JoinCard() {
</Row>
<Row>
{!currentUser?.signed_in && (
env?.OPENID_CONNECT ? (
env?.EXTERNAL_AUTH ? (
<Stack direction="horizontal" className="d-flex justify-content-center text-muted mt-3"> {t('authentication.already_have_account')}
<RegularForm action={process.env.OMNIAUTH_PATH} method="POST" data-turbo="false">
<input type="hidden" name="authenticity_token" value={document.querySelector('meta[name="csrf-token"]').content} />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ export default function RequireAuthentication({ path }) {
</Card.Body>
<Card.Footer className="bg-white">
{
env?.OPENID_CONNECT ? (
env?.EXTERNAL_AUTH ? (
<Form action={process.env.OMNIAUTH_PATH} method="POST" data-turbo="false">
<input type="hidden" name="authenticity_token" value={document.querySelector('meta[name="csrf-token"]').content} />
<Button variant="brand-outline-color" className="btn btn-lg m-2" type="submit">{t('authentication.sign_up')}</Button>
Expand Down
2 changes: 1 addition & 1 deletion app/javascript/components/users/authentication/Signup.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ export default function Signup() {
const envAPI = useEnv();
const isLoading = envAPI.isLoading || registrationMethodSettingAPI.isLoading;

if (envAPI.data?.OPENID_CONNECT) {
if (envAPI.data?.EXTERNAL_AUTH) {
return <Navigate to="/" replace />;
}

Expand Down
2 changes: 1 addition & 1 deletion esbuild.dev.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ await esbuild.build({
},
define: {
'process.env.RELATIVE_URL_ROOT': `"${relativeUrlRoot}"`,
'process.env.OMNIAUTH_PATH': `"${relativeUrlRoot}/auth/openid_connect"`,
'process.env.OMNIAUTH_PATH': `"${relativeUrlRoot}/auth/openid_connect"`, // currently, only OIDC is implemented
},
});

Expand Down
2 changes: 1 addition & 1 deletion esbuild.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ await esbuild.build({
},
define: {
'process.env.RELATIVE_URL_ROOT': `"${relativeUrlRoot}"`,
'process.env.OMNIAUTH_PATH': `"${relativeUrlRoot}/auth/openid_connect"`,
'process.env.OMNIAUTH_PATH': `"${relativeUrlRoot}/auth/openid_connect"`, // currently, only OIDC is implemented
},
});

Expand Down