Skip to content

Commit

Permalink
chore: revert logout old token
Browse files Browse the repository at this point in the history
  • Loading branch information
abuaboud committed Feb 4, 2024
1 parent a2a80db commit 1c681a9
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 22 deletions.
6 changes: 4 additions & 2 deletions packages/backend/src/app/ee/platform/lib/platform-utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,14 @@ import { FastifyRequest } from 'fastify'
import { customDomainService } from '../../custom-domains/custom-domain.service'
import { getEdition } from '../../../helper/secret-helper'
import { platformService } from '../platform.service'
import { system } from '../../../helper/system/system'
import { SystemProp } from '../../../helper/system/system-prop'

const edition = getEdition()

export const resolvePlatformIdForRequest = async (request: FastifyRequest): Promise<string | null> => {
if (edition === ApEdition.COMMUNITY) {
return getDefaultPlatformId()
return null
}

return await extractPlatformIdFromAuthenticatedPrincipal(request.principal)
Expand All @@ -29,5 +31,5 @@ async function getDefaultPlatformId(): Promise<null | string> {
const platform = await platformService.getOldestPlatform()
return platform?.id ?? null
}
return null
return system.getOrThrow(SystemProp.CLOUD_PLATFORM_ID)
}
1 change: 0 additions & 1 deletion packages/ui/core/src/app/app.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
</div>
<ng-container *ngIf="loggedInUser$ | async"></ng-container>
<ng-container *ngIf="routeLoader$ | async"></ng-container>
<ng-container *ngIf="logoutOldTokens$ | async"></ng-container>
<ng-container *ngIf="importTemplate$ | async"></ng-container>
<ng-container *ngIf="theme$ | async"> </ng-container>
<ng-container *ngIf="setTitle$ | async"></ng-container>
Expand Down
20 changes: 1 addition & 19 deletions packages/ui/core/src/app/app.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,7 @@ import {
FlowBuilderService,
} from '@activepieces/ui/common';
import { compareVersions } from 'compare-versions';
import {
ApEdition,
ApFlagId,
LocalesEnum,
User,
isNil,
} from '@activepieces/shared';
import { ApEdition, ApFlagId, LocalesEnum, User } from '@activepieces/shared';
import {
TelemetryService,
EmbeddingService,
Expand Down Expand Up @@ -99,18 +93,6 @@ export class AppComponent implements OnInit {
tap(() => this.loadingTheme$.next(false)),
map(() => void 0)
);
// TODO remove in next release
this.logoutOldTokens$ = this.flagService.getEdition().pipe(
tap((edition) => {
if (
edition === ApEdition.CLOUD &&
isNil(this.authenticationService.getDecodedToken()?.platform)
) {
this.authenticationService.logout();
}
}),
map(() => void 0)
);
this.embeddedRouteListener$ = this.createEmbeddingRoutesListener();
this.routeLoader$ = this.createRouteListenerToToggleLoadingAndSetTitle();
this.showUpgradeNotification$ =
Expand Down

0 comments on commit 1c681a9

Please sign in to comment.