Skip to content

Commit 0f6570a

Browse files
committed
fix: add support one DATABASE_URL, and create all needed from it, rename RestSdkService to SsoRestSdkService
1 parent 7656314 commit 0f6570a

File tree

23 files changed

+221
-198
lines changed

23 files changed

+221
-198
lines changed

apps/client/src/app/app-initializer.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { Injectable } from '@angular/core';
22
import { TranslocoService } from '@jsverse/transloco';
3-
import { RestSdkAngularService } from '@nestjs-mod/sso-rest-sdk-angular';
3+
import { SsoRestSdkAngularService } from '@nestjs-mod/sso-rest-sdk-angular';
44
import {
55
SsoActiveLangService,
66
SsoActiveProjectService,
@@ -19,7 +19,7 @@ export class AppInitializer {
1919
private readonly tokensService: TokensService,
2020
private readonly ssoActiveLangService: SsoActiveLangService,
2121
private readonly ssoActiveProjectService: SsoActiveProjectService,
22-
private readonly restSdkAngularService: RestSdkAngularService
22+
private readonly ssoRestSdkAngularService: SsoRestSdkAngularService
2323
) {}
2424

2525
resolve() {
@@ -52,7 +52,7 @@ export class AppInitializer {
5252
private updateHeaders() {
5353
const authorizationHeaders = this.ssoService.getAuthorizationHeaders();
5454
if (authorizationHeaders) {
55-
this.restSdkAngularService.updateHeaders(authorizationHeaders);
55+
this.ssoRestSdkAngularService.updateHeaders(authorizationHeaders);
5656
}
5757
}
5858
}

apps/client/src/app/app.component.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ import {
4343
} from 'rxjs';
4444
import { APP_TITLE } from './app.constants';
4545

46-
import { RestSdkAngularService } from '@nestjs-mod/sso-rest-sdk-angular';
46+
import { SsoRestSdkAngularService } from '@nestjs-mod/sso-rest-sdk-angular';
4747
@UntilDestroy()
4848
@Component({
4949
imports: [
@@ -77,7 +77,7 @@ export class AppComponent implements OnInit {
7777
activePublicProject$?: Observable<SsoProjectModel | undefined>;
7878

7979
constructor(
80-
private readonly restSdkAngularService: RestSdkAngularService,
80+
private readonly ssoRestSdkAngularService: SsoRestSdkAngularService,
8181
private readonly ssoService: SsoService,
8282
private readonly router: Router,
8383
private readonly translocoService: TranslocoService,
@@ -174,12 +174,12 @@ export class AppComponent implements OnInit {
174174

175175
private fillServerTime() {
176176
return merge(
177-
this.restSdkAngularService.getTimeApi().timeControllerTime(),
177+
this.ssoRestSdkAngularService.getTimeApi().timeControllerTime(),
178178
this.tokensService
179179
.getStream()
180180
.pipe(
181181
switchMap((token) =>
182-
this.restSdkAngularService.webSocket<string>({
182+
this.ssoRestSdkAngularService.webSocket<string>({
183183
path: token?.access_token
184184
? `/ws/time?token=${token?.access_token}`
185185
: '/ws/time',

apps/client/src/app/integrations/sso.configuration.ts

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { Provider } from '@angular/core';
22
import { TranslocoService } from '@jsverse/transloco';
33
import { FilesService } from '@nestjs-mod-sso/files-angular';
44
import {
5-
RestSdkAngularService,
5+
SsoRestSdkAngularService,
66
SsoUserDtoInterface,
77
TokensResponseInterface,
88
} from '@nestjs-mod/sso-rest-sdk-angular';
@@ -28,7 +28,7 @@ import { catchError, map, mergeMap, Observable, of } from 'rxjs';
2828

2929
export class SsoIntegrationConfiguration implements SsoConfiguration {
3030
constructor(
31-
private readonly restSdkAngularService: RestSdkAngularService,
31+
private readonly ssoRestSdkAngularService: SsoRestSdkAngularService,
3232
private readonly filesService: FilesService,
3333
private readonly translocoService: TranslocoService,
3434
private readonly tokensService: TokensService,
@@ -56,7 +56,7 @@ export class SsoIntegrationConfiguration implements SsoConfiguration {
5656
}
5757

5858
oAuthProviders(): Observable<OAuthProvider[]> {
59-
return this.restSdkAngularService
59+
return this.ssoRestSdkAngularService
6060
.getSsoApi()
6161
.ssoOAuthControllerOauthProviders();
6262
}
@@ -67,7 +67,7 @@ export class SsoIntegrationConfiguration implements SsoConfiguration {
6767
}: OAuthVerificationInput): Observable<SsoUserAndTokens> {
6868
return this.fingerprintService.getFingerprint().pipe(
6969
mergeMap((fingerprint) =>
70-
this.restSdkAngularService
70+
this.ssoRestSdkAngularService
7171
.getSsoApi()
7272
.ssoOAuthControllerOauthVerification({
7373
fingerprint,
@@ -85,7 +85,7 @@ export class SsoIntegrationConfiguration implements SsoConfiguration {
8585

8686
logout(): Observable<void | null> {
8787
const refreshToken = this.tokensService.getRefreshToken();
88-
return this.restSdkAngularService
88+
return this.ssoRestSdkAngularService
8989
.getSsoApi()
9090
.ssoControllerSignOut(
9191
refreshToken
@@ -102,7 +102,7 @@ export class SsoIntegrationConfiguration implements SsoConfiguration {
102102
}
103103

104104
getProfile(): Observable<SsoUser | undefined> {
105-
return this.restSdkAngularService
105+
return this.ssoRestSdkAngularService
106106
.getSsoApi()
107107
.ssoControllerProfile()
108108
.pipe(
@@ -154,7 +154,7 @@ export class SsoIntegrationConfiguration implements SsoConfiguration {
154154
return of(undefined);
155155
}),
156156
mergeMap((picture) => {
157-
return this.restSdkAngularService
157+
return this.ssoRestSdkAngularService
158158
.getSsoApi()
159159
.ssoControllerUpdateProfile({
160160
birthdate: data.birthdate,
@@ -169,7 +169,7 @@ export class SsoIntegrationConfiguration implements SsoConfiguration {
169169
});
170170
}),
171171
mergeMap(() =>
172-
this.restSdkAngularService.getSsoApi().ssoControllerProfile()
172+
this.ssoRestSdkAngularService.getSsoApi().ssoControllerProfile()
173173
),
174174
mergeMap((newData) => {
175175
if (
@@ -191,7 +191,7 @@ export class SsoIntegrationConfiguration implements SsoConfiguration {
191191
const refreshToken = this.tokensService.getRefreshToken();
192192
return this.fingerprintService.getFingerprint().pipe(
193193
mergeMap((fingerprint) =>
194-
this.restSdkAngularService
194+
this.ssoRestSdkAngularService
195195
.getSsoApi()
196196
.ssoControllerRefreshTokens({
197197
...(refreshToken
@@ -224,7 +224,7 @@ export class SsoIntegrationConfiguration implements SsoConfiguration {
224224
}
225225
return this.fingerprintService.getFingerprint().pipe(
226226
mergeMap((fingerprint) =>
227-
this.restSdkAngularService
227+
this.ssoRestSdkAngularService
228228
.getSsoApi()
229229
.ssoControllerSignUp({
230230
email,
@@ -250,7 +250,7 @@ export class SsoIntegrationConfiguration implements SsoConfiguration {
250250
}
251251
return this.fingerprintService.getFingerprint().pipe(
252252
mergeMap((fingerprint) =>
253-
this.restSdkAngularService
253+
this.ssoRestSdkAngularService
254254
.getSsoApi()
255255
.ssoControllerSignIn({
256256
email,
@@ -274,7 +274,7 @@ export class SsoIntegrationConfiguration implements SsoConfiguration {
274274
}
275275
return this.fingerprintService.getFingerprint().pipe(
276276
mergeMap((fingerprint) =>
277-
this.restSdkAngularService
277+
this.ssoRestSdkAngularService
278278
.getSsoApi()
279279
.ssoControllerCompleteSignUp({
280280
code,
@@ -305,7 +305,7 @@ export class SsoIntegrationConfiguration implements SsoConfiguration {
305305
}
306306
return this.fingerprintService.getFingerprint().pipe(
307307
mergeMap((fingerprint) =>
308-
this.restSdkAngularService
308+
this.ssoRestSdkAngularService
309309
.getSsoApi()
310310
.ssoControllerCompleteForgotPassword({
311311
password,
@@ -328,7 +328,7 @@ export class SsoIntegrationConfiguration implements SsoConfiguration {
328328
if (!email) {
329329
throw new Error('email not set');
330330
}
331-
return this.restSdkAngularService
331+
return this.ssoRestSdkAngularService
332332
.getSsoApi()
333333
.ssoControllerForgotPassword({
334334
email,
@@ -343,7 +343,7 @@ export function provideSsoConfiguration(): Provider {
343343
provide: SSO_CONFIGURATION_TOKEN,
344344
useClass: SsoIntegrationConfiguration,
345345
deps: [
346-
RestSdkAngularService,
346+
SsoRestSdkAngularService,
347347
FilesService,
348348
TranslocoService,
349349
TokensService,

0 commit comments

Comments
 (0)