Skip to content

Commit cc71899

Browse files
committed
Add non-prod ODIC URL warning on admin settings UI.
1 parent af06d2e commit cc71899

File tree

2 files changed

+14
-0
lines changed

2 files changed

+14
-0
lines changed

frontend/src/views/settings/security.vue

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,10 @@
3535
<b-field :label="$t('settings.security.OIDCRedirectURL')">
3636
<code><copy-text :text="`${serverConfig.root_url}/auth/oidc`" /></code>
3737
</b-field>
38+
<p v-if="!isURLOk" class="has-text-danger">
39+
<b-icon icon="warning-empty" />
40+
{{ $t('settings.security.OIDCRedirectWarning') }}
41+
</p>
3842
</div>
3943
</div>
4044

@@ -93,6 +97,15 @@ export default Vue.extend({
9397
isMobile() {
9498
return this.windowWidth <= 768;
9599
},
100+
101+
isURLOk() {
102+
try {
103+
const u = new URL(this.serverConfig.root_url);
104+
return u.hostname !== 'localhost' && u.hostname !== '127.0.0.1';
105+
} catch (e) {
106+
return false;
107+
}
108+
},
96109
},
97110
98111
methods: {

i18n/en.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -368,6 +368,7 @@
368368
"settings.security.OIDCClientID": "Client ID",
369369
"settings.security.OIDCClientSecret": "Client secret",
370370
"settings.security.OIDCRedirectURL": "Redirect URL for oAuth provider",
371+
"settings.security.OIDCRedirectWarning": "This does not seem to be a production URL. Change the Root URL in 'General' settings.",
371372
"settings.appearance.adminHelp": "Custom CSS to apply to the admin UI.",
372373
"settings.appearance.adminName": "Admin",
373374
"settings.appearance.customCSS": "Custom CSS",

0 commit comments

Comments
 (0)