Skip to content

Commit 3a97a89

Browse files
committed
chore: bump backend-contract version to 2.1.60 and add branding fields to auth commands and responses
- Updated version in package.json to 2.1.60. - Added optional branding fields (title and logoUrl) to GetStatusCommand and GetStatusResponseModel. - Enhanced AuthService to include branding information from configuration.
1 parent aea5370 commit 3a97a89

File tree

5 files changed

+28
-1
lines changed

5 files changed

+28
-1
lines changed

libs/contract/commands/auth/get-status.command.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,10 @@ export namespace GetStatusCommand {
2525
oauth2: z.object({
2626
providers: z.record(z.nativeEnum(OAUTH2_PROVIDERS), z.boolean()),
2727
}),
28+
branding: z.object({
29+
title: z.nullable(z.string()),
30+
logoUrl: z.nullable(z.string()),
31+
}),
2832
}),
2933
});
3034

libs/contract/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@remnawave/backend-contract",
3-
"version": "2.1.58",
3+
"version": "2.1.60",
44
"public": true,
55
"license": "AGPL-3.0-only",
66
"description": "A contract library for Remnawave Backend. It can be used in backend and frontend.",

src/common/config/app-config/config.schema.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -174,6 +174,9 @@ export const configSchema = z
174174
}
175175
})
176176
.pipe(z.array(z.string()).optional()),
177+
178+
BRANDING_TITLE: z.string().optional(),
179+
BRANDING_LOGO_URL: z.string().optional(),
177180
})
178181
.superRefine((data, ctx) => {
179182
if (data.WEBHOOK_ENABLED === 'true') {

src/modules/auth/auth.service.ts

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,10 @@ export class AuthService {
5757
client: arctic.Yandex;
5858
allowedEmails: string[];
5959
};
60+
private readonly branding: {
61+
title: string | null;
62+
logoUrl: string | null;
63+
};
6064
private readonly oauth2Providers: Record<TOAuth2ProvidersKeys, boolean>;
6165

6266
constructor(
@@ -79,6 +83,11 @@ export class AuthService {
7983
this.configService.get<string>('OAUTH2_YANDEX_ENABLED') === 'true';
8084
const isTgAuthEnabled = this.configService.get<string>('TELEGRAM_OAUTH_ENABLED') === 'true';
8185

86+
this.branding = {
87+
title: this.configService.get<string>('BRANDING_TITLE') ?? null,
88+
logoUrl: this.configService.get<string>('BRANDING_LOGO_URL') ?? null,
89+
};
90+
8291
this.oauth2Providers = {
8392
[OAUTH2_PROVIDERS.GITHUB]: isGithubAuthEnabled,
8493
[OAUTH2_PROVIDERS.POCKETID]: isPocketIdAuthEnabled,
@@ -377,6 +386,7 @@ export class AuthService {
377386
]),
378387
) as Record<TOAuth2ProvidersKeys, boolean>,
379388
},
389+
branding: this.branding,
380390
}),
381391
};
382392
}
@@ -390,6 +400,7 @@ export class AuthService {
390400
oauth2: {
391401
providers: this.oauth2Providers,
392402
},
403+
branding: this.branding,
393404
}),
394405
};
395406
} catch (error) {

src/modules/auth/model/get-status.response.model.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,10 @@ export class GetStatusResponseModel {
99
public readonly oauth2: {
1010
providers: Record<TOAuth2ProvidersKeys, boolean>;
1111
};
12+
public readonly branding: {
13+
title: string | null;
14+
logoUrl: string | null;
15+
};
1216

1317
constructor(data: {
1418
isLoginAllowed: boolean;
@@ -19,10 +23,15 @@ export class GetStatusResponseModel {
1923
oauth2: {
2024
providers: Record<TOAuth2ProvidersKeys, boolean>;
2125
};
26+
branding: {
27+
title: string | null;
28+
logoUrl: string | null;
29+
};
2230
}) {
2331
this.isLoginAllowed = data.isLoginAllowed;
2432
this.isRegisterAllowed = data.isRegisterAllowed;
2533
this.tgAuth = data.tgAuth;
2634
this.oauth2 = data.oauth2;
35+
this.branding = data.branding;
2736
}
2837
}

0 commit comments

Comments
 (0)