Skip to content

Commit dbcd12d

Browse files
author
nicolasschneider
committed
add optional OPENID_DISPLAY_NAME env variable that is used in the login button
Signed-off-by: nicolasschneider <[email protected]>
1 parent 8e2e184 commit dbcd12d

File tree

5 files changed

+11
-1
lines changed

5 files changed

+11
-1
lines changed

desktop/src/ui/platform.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -250,6 +250,7 @@ export async function configurePlatform (): Promise<void> {
250250

251251
setMetadata(login.metadata.AccountsUrl, config.ACCOUNTS_URL)
252252
setMetadata(login.metadata.DisableSignUp, config.DISABLE_SIGNUP === 'true')
253+
setMetadata(login.metadata.OpenIdDisplayName, config.OPENID_DISPLAY_NAME)
253254
setMetadata(presentation.metadata.UploadURL, config.UPLOAD_URL)
254255
setMetadata(presentation.metadata.FilesURL, config.FILES_URL)
255256
setMetadata(presentation.metadata.CollaboratorUrl, config.COLLABORATOR_URL)

desktop/src/ui/types.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ export interface Config {
1515
DESKTOP_UPDATES_CHANNEL?: string
1616
DESKTOP_UPDATES_URL?: string
1717
DISABLE_SIGNUP?: string
18+
OPENID_DISPLAY_NAME?: string
1819
FILES_URL: string
1920
FRONT_URL: string
2021
GITHUB_APP: string

dev/prod/src/platform.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -175,6 +175,7 @@ export interface Config {
175175
TELEGRAM_BOT_URL?: string
176176
AI_URL?: string
177177
DISABLE_SIGNUP?: string
178+
OPENID_DISPLAY_NAME?: string
178179
LINK_PREVIEW_URL?: string
179180
PASSWORD_STRICTNESS?: 'very_strict' | 'strict' | 'normal' | 'none'
180181
// Could be defined for dev environment
@@ -423,6 +424,7 @@ export async function configurePlatform() {
423424

424425
setMetadata(login.metadata.AccountsUrl, config.ACCOUNTS_URL)
425426
setMetadata(login.metadata.DisableSignUp, config.DISABLE_SIGNUP === 'true')
427+
setMetadata(login.metadata.OpenIdDisplayName, config.OPENID_DISPLAY_NAME)
426428

427429
setMetadata(login.metadata.PasswordValidations, PASSWORD_REQUIREMENTS[config.PASSWORD_STRICTNESS ?? 'none'])
428430

plugins/login-resources/src/components/providers/OpenId.svelte

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,12 @@
22
import { Label } from '@hcengineering/ui'
33
import OpenId from '../icons/OpenId.svelte'
44
import login from '../../plugin'
5+
import { getMetadata } from '@hcengineering/platform'
6+
7+
const openIdDisplayName = getMetadata(login.metadata.DisableSignUp) ?? 'OpenId'
58
</script>
69

710
<div class="flex-row-center flex-gap-2">
811
<OpenId />
9-
<Label label={login.string.ContinueWith} params={{ provider: 'OpenId' }} />
12+
<Label label={login.string.ContinueWith} params={{ provider: openIdDisplayName }} />
1013
</div>

server/front/src/starter.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,8 @@ export function startFront (ctx: MeasureContext, extraConfig?: Record<string, st
119119

120120
const disableSignUp = process.env.DISABLE_SIGNUP
121121

122+
const openIdDisplayName = process.env.OPENID_DISPLAY_NAME
123+
122124
const mailUrl = process.env.MAIL_URL
123125

124126
const config = {
@@ -140,6 +142,7 @@ export function startFront (ctx: MeasureContext, extraConfig?: Record<string, st
140142
uploadConfig,
141143
pushPublicKey,
142144
disableSignUp,
145+
openIdDisplayName,
143146
linkPreviewUrl,
144147
streamUrl,
145148
mailUrl

0 commit comments

Comments
 (0)