Skip to content

Commit

Permalink
👕
Browse files Browse the repository at this point in the history
  • Loading branch information
flvndvd committed Mar 8, 2024
1 parent 7bd5282 commit c12e091
Show file tree
Hide file tree
Showing 11 changed files with 12 additions and 17 deletions.
3 changes: 2 additions & 1 deletion front/lib/iam/provider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,8 @@ function isAuth0Session(session: unknown): session is Session {

// We only expose generic types to ease phasing out.

export type SessionWithUser = Omit<Session, "user"> & { user: ExternalUser };
// Overrides the Auth0 type definition entirely, to only expose what we need.
export type SessionWithUser = { user: ExternalUser };

export function isValidSession(
session: Session | null
Expand Down
2 changes: 1 addition & 1 deletion front/pages/poke/[wId]/assistants/[aId]/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import { withSuperUserAuthRequirements } from "@app/lib/iam/session";

export const getServerSideProps = withSuperUserAuthRequirements<{
agentConfigurations: AgentConfigurationType[];
}>(async (context, session, auth) => {
}>(async (context, auth) => {
if (!auth.isDustSuperUser()) {
return {
notFound: true,
Expand Down
2 changes: 1 addition & 1 deletion front/pages/poke/[wId]/data_sources/[name]/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ export const getServerSideProps = withSuperUserAuthRequirements<{
githubCodeSyncEnabled: boolean;
};
temporalWorkspace: string;
}>(async (context, session, auth) => {
}>(async (context, auth) => {
const owner = auth.workspace();

if (!owner || !auth.isDustSuperUser()) {
Expand Down
2 changes: 1 addition & 1 deletion front/pages/poke/[wId]/data_sources/[name]/search.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import { classNames, timeAgoFrom } from "@app/lib/utils";
export const getServerSideProps = withSuperUserAuthRequirements<{
owner: WorkspaceType;
dataSource: DataSourceType;
}>(async (context, session, auth) => {
}>(async (context, auth) => {
const owner = auth.workspace();

if (!owner || !auth.isAdmin()) {
Expand Down
2 changes: 1 addition & 1 deletion front/pages/poke/[wId]/data_sources/[name]/view.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import logger from "@app/logger/logger";

export const getServerSideProps = withSuperUserAuthRequirements<{
document: CoreAPIDocument;
}>(async (context, session, auth) => {
}>(async (context, auth) => {
if (!auth.isDustSuperUser()) {
return {
notFound: true,
Expand Down
2 changes: 1 addition & 1 deletion front/pages/poke/[wId]/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ export const getServerSideProps = withSuperUserAuthRequirements<{
agentConfigurations: AgentConfigurationType[];
whitelistableFeatures: WhitelistableFeature[];
registry: typeof DustProdActionRegistry;
}>(async (context, session, auth) => {
}>(async (context, auth) => {
const owner = auth.workspace();
const subscription = auth.subscription();

Expand Down
2 changes: 1 addition & 1 deletion front/pages/poke/[wId]/memberships.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import { withSuperUserAuthRequirements } from "@app/lib/iam/session";
export const getServerSideProps = withSuperUserAuthRequirements<{
owner: WorkspaceType;
members: UserTypeWithWorkspaces[];
}>(async (context, session, auth) => {
}>(async (context, auth) => {
const owner = auth.workspace();

if (!owner || !auth.isDustSuperUser()) {
Expand Down
2 changes: 1 addition & 1 deletion front/pages/poke/connectors/[connectorId]/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { withSuperUserAuthRequirements } from "@app/lib/iam/session";
import logger from "@app/logger/logger";

export const getServerSideProps = withSuperUserAuthRequirements<object>(
async (context, session, auth) => {
async (context, auth) => {
if (!auth.isDustSuperUser()) {
return {
notFound: true,
Expand Down
2 changes: 1 addition & 1 deletion front/pages/poke/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import { withSuperUserAuthRequirements } from "@app/lib/iam/session";
import { usePokeWorkspaces } from "@app/lib/swr";

export const getServerSideProps = withSuperUserAuthRequirements<object>(
async (context, session, auth) => {
async (context, auth) => {
if (!auth.isDustSuperUser()) {
return {
notFound: true,
Expand Down
2 changes: 1 addition & 1 deletion front/pages/poke/plans.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ import { withSuperUserAuthRequirements } from "@app/lib/iam/session";
import { usePokePlans } from "@app/lib/swr";

export const getServerSideProps = withSuperUserAuthRequirements<object>(
async (context, session, auth) => {
async (context, auth) => {
if (!auth.isDustSuperUser()) {
return {
notFound: true,
Expand Down
8 changes: 1 addition & 7 deletions front/pages/w/[wId]/builder/data-sources/new.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ import AppLayout from "@app/components/sparkle/AppLayout";
import { AppLayoutSimpleSaveCancelTitle } from "@app/components/sparkle/AppLayoutTitle";
import { subNavigationBuild } from "@app/components/sparkle/navigation";
import { getDataSources } from "@app/lib/api/data_sources";
import { Authenticator } from "@app/lib/auth";
import { withDefaultUserAuthRequirements } from "@app/lib/iam/session";
import { classNames } from "@app/lib/utils";

Expand All @@ -22,12 +21,7 @@ export const getServerSideProps = withDefaultUserAuthRequirements<{
subscription: SubscriptionType;
dataSources: DataSourceType[];
gaTrackingId: string;
}>(async (context, session) => {
const auth = await Authenticator.fromSession(
session,
context.params?.wId as string
);

}>(async (context, auth) => {
const owner = auth.workspace();
const subscription = auth.subscription();

Expand Down

0 comments on commit c12e091

Please sign in to comment.