diff --git a/.github/workflows/deploy-backend.yml b/.github/workflows/deploy-backend.yml
index 149ce04..5924461 100644
--- a/.github/workflows/deploy-backend.yml
+++ b/.github/workflows/deploy-backend.yml
@@ -27,11 +27,12 @@ jobs:
repository: musicfestival
- name: Publish to Registry
- uses: elgohr/Publish-Docker-Github-Action@master
+ uses: elgohr/Publish-Docker-Github-Action@v5
with:
name: musicfestival
username: ${{ steps.ecr.outputs.username }}
password: ${{ steps.ecr.outputs.password }}
registry: musicfestivalacr.azurecr.io
workdir: samples/musicfestival-backend-dotnet
+ buildoptions: "--compress --force-rm"
tags: "latest"
diff --git a/samples/musicfestival-backend-dotnet/MusicFestival.Backend.csproj b/samples/musicfestival-backend-dotnet/MusicFestival.Backend.csproj
index 887b07c..cb4887b 100644
--- a/samples/musicfestival-backend-dotnet/MusicFestival.Backend.csproj
+++ b/samples/musicfestival-backend-dotnet/MusicFestival.Backend.csproj
@@ -8,12 +8,13 @@
-
+
+
-
-
+
+
diff --git a/samples/musicfestival-backend-dotnet/Startup.cs b/samples/musicfestival-backend-dotnet/Startup.cs
index 73db0d0..7e0f158 100644
--- a/samples/musicfestival-backend-dotnet/Startup.cs
+++ b/samples/musicfestival-backend-dotnet/Startup.cs
@@ -87,6 +87,7 @@ public void ConfigureServices(IServiceCollection services)
new Uri(baseUri, "/"),
new Uri(baseUri, "/login-callback"),
new Uri(baseUri, "/login-renewal"),
+ new Uri(baseUri, "/api/auth/callback/optimizely_cms"),
},
});
@@ -147,7 +148,7 @@ public void Configure(IApplicationBuilder app, IWebHostEnvironment env)
app.UseStaticFiles();
app.UseRouting();
app.UseCors(b => b
- .WithOrigins(new[] { $"{_frontendUri}" })
+ .WithOrigins(new[] { $"{_frontendUri}", "*" })
.WithExposedContentDeliveryApiHeaders()
.WithExposedContentDefinitionApiHeaders()
.WithHeaders("Authorization")
diff --git a/samples/musicfestival-frontend-nextjs/.env.local b/samples/musicfestival-frontend-nextjs/.env.local
index a22d967..9359fd6 100644
--- a/samples/musicfestival-frontend-nextjs/.env.local
+++ b/samples/musicfestival-frontend-nextjs/.env.local
@@ -1,6 +1,6 @@
NEXTAUTH_URL=http://localhost:3000/
AZURE_AD_CLIENT_ID=355bdf4f-d596-4db7-8efe-8e3bc24a3611
-AZURE_AD_CLIENT_SECRET=dBo8Q~qaopwwO-O3gL_Hv58HQHTJ1faWPpFxudcl
+AZURE_AD_CLIENT_SECRET=eOn8Q~KxYudVYDmBs6OYYb9xolWvv~I1LdB1nbSc
AZURE_AD_TENANT_ID=7c4a1b79-4b8e-4ac7-b7e1-c5c3c5a4c139
OKTA_CLIENT_ID=0oa7c6ejkpzJ0CtcS1d7
OKTA_ISSUER=https://prep.login.optimizely.com
diff --git a/samples/musicfestival-frontend-nextjs/components/Login-Callback.tsx b/samples/musicfestival-frontend-nextjs/components/Login-Callback.tsx
deleted file mode 100644
index 9804144..0000000
--- a/samples/musicfestival-frontend-nextjs/components/Login-Callback.tsx
+++ /dev/null
@@ -1,23 +0,0 @@
-
-import { UserManager, WebStorageStateStore } from 'oidc-client';
-
-function LoginCallback() {
- const settings = {
- response_mode: 'query',
- userStore: new WebStorageStateStore({}),
- };
-
- new UserManager(settings).signinRedirectCallback().then((user) => {
- if (user && user.state) {
- window.location.href = user.state;
- } else {
- window.location.href = window.location.origin;
- }
- }).catch((err) => {
- console.error(err);
- });
-
- return <>>;
-}
-
-export default LoginCallback;
\ No newline at end of file
diff --git a/samples/musicfestival-frontend-nextjs/components/LoginBtn.tsx b/samples/musicfestival-frontend-nextjs/components/LoginBtn.tsx
index 7eaa4bc..8d9bb53 100644
--- a/samples/musicfestival-frontend-nextjs/components/LoginBtn.tsx
+++ b/samples/musicfestival-frontend-nextjs/components/LoginBtn.tsx
@@ -1,17 +1,18 @@
import { Session } from "next-auth"
import { useSession, signIn, signOut } from "next-auth/react"
-type ExtendedSession = Session & {
- token: any
+export type ExtendedSession = Session & {
+ token?: any
}
export default function Component() {
- const { data: session } = useSession()
+ const { data: session, status } = useSession()
const extendedSession: ExtendedSession = session as ExtendedSession
- if (extendedSession) {
+ if (extendedSession && status === "authenticated") {
+ const userName = extendedSession.token?.user?.name || extendedSession.token?.name
return (
-
+
)
}
diff --git a/samples/musicfestival-frontend-nextjs/components/PageComponent/LandingPageComponent.tsx b/samples/musicfestival-frontend-nextjs/components/PageComponent/LandingPageComponent.tsx
index 574de31..aecb409 100644
--- a/samples/musicfestival-frontend-nextjs/components/PageComponent/LandingPageComponent.tsx
+++ b/samples/musicfestival-frontend-nextjs/components/PageComponent/LandingPageComponent.tsx
@@ -29,7 +29,6 @@ function LandingPage({ content }: LandingPageProps) {
(() => {
const contentItem = mainContentAreaItem?.ContentLink?.Expanded
if (contentItem?.__typename === "ImageFile") {
- console.log('contentItem', contentItem?.Url)
return (
diff --git a/samples/musicfestival-frontend-nextjs/components/PageComponent/LoginCallbackPageComponent.tsx b/samples/musicfestival-frontend-nextjs/components/PageComponent/LoginCallbackPageComponent.tsx
deleted file mode 100644
index 0ac736a..0000000
--- a/samples/musicfestival-frontend-nextjs/components/PageComponent/LoginCallbackPageComponent.tsx
+++ /dev/null
@@ -1,23 +0,0 @@
-
-import { UserManager, WebStorageStateStore } from 'oidc-client';
-
-function LoginCallbackPage() {
- const settings = {
- response_mode: 'query',
- userStore: new WebStorageStateStore({}),
- };
-
- new UserManager(settings).signinRedirectCallback().then((user) => {
- if (user && user.state) {
- window.location.href = user.state;
- } else {
- window.location.href = window.location.origin;
- }
- }).catch((err) => {
- console.error(err);
- });
-
- return <>>;
-}
-
-export default LoginCallbackPage;
\ No newline at end of file
diff --git a/samples/musicfestival-frontend-nextjs/generated/graphql.ts b/samples/musicfestival-frontend-nextjs/generated/graphql.ts
index adb4200..154cdfe 100644
--- a/samples/musicfestival-frontend-nextjs/generated/graphql.ts
+++ b/samples/musicfestival-frontend-nextjs/generated/graphql.ts
@@ -1,118 +1,116 @@
-import { useQuery, UseQueryOptions } from '@tanstack/react-query';
+import { GraphQLClient } from 'graphql-request';
+import { GraphQLClientRequestHeaders } from 'graphql-request/build/cjs/types';
+import gql from 'graphql-tag';
export type Maybe
= T | null;
export type InputMaybe = Maybe;
export type Exact = { [K in keyof T]: T[K] };
export type MakeOptional = Omit & { [SubKey in K]?: Maybe };
export type MakeMaybe = Omit & { [SubKey in K]: Maybe };
-
-function fetcher(endpoint: string, requestInit: RequestInit, query: string, variables?: TVariables) {
- return async (): Promise => {
- const res = await fetch(endpoint, {
- method: 'POST',
- ...requestInit,
- body: JSON.stringify({ query, variables }),
- });
-
- const json = await res.json();
-
- if (json.errors) {
- const { message } = json.errors[0];
-
- throw new Error(message);
- }
-
- return json.data;
- }
-}
+export type MakeEmpty = { [_ in K]?: never };
+export type Incremental = T | { [P in keyof T]?: P extends ' $fragmentName' | '__typename' ? T[P] : never };
/** All built-in and custom scalars, mapped to their actual values */
export type Scalars = {
- ID: string;
- String: string;
- Boolean: boolean;
- Int: number;
- Float: number;
- Bool: any;
- Date: any;
+ ID: { input: string; output: string; }
+ String: { input: string; output: string; }
+ Boolean: { input: boolean; output: boolean; }
+ Int: { input: number; output: number; }
+ Float: { input: number; output: number; }
+ Bool: { input: any; output: any; }
+ Date: { input: any; output: any; }
};
export type ArtistContainerPage = IContent & {
__typename?: 'ArtistContainerPage';
- Ancestors?: Maybe>>;
+ Ancestors?: Maybe>>;
Category?: Maybe>>;
- Changed?: Maybe;
+ Changed?: Maybe;
ContentLink?: Maybe;
- ContentType?: Maybe>>;
- Created?: Maybe;
+ ContentType?: Maybe>>;
+ Created?: Maybe;
ExistingLanguages?: Maybe>>;
- IsCommonDraft?: Maybe;
+ IsCommonDraft?: Maybe;
Language?: Maybe;
MasterLanguage?: Maybe;
- Name?: Maybe;
+ Name?: Maybe;
ParentLink?: Maybe;
- RelativePath?: Maybe;
- RouteSegment?: Maybe;
- Saved?: Maybe;
- StartPublish?: Maybe;
- Status?: Maybe;
- StopPublish?: Maybe;
- Url?: Maybe;
+ RelativePath?: Maybe;
+ RouteSegment?: Maybe;
+ Saved?: Maybe;
+ SiteId?: Maybe;
+ StartPublish?: Maybe;
+ Status?: Maybe;
+ StopPublish?: Maybe;
+ Url?: Maybe;
_children?: Maybe;
- _deleted?: Maybe;
- _fulltext?: Maybe>>;
- _modified?: Maybe;
- _score?: Maybe;
+ _deleted?: Maybe;
+ _fulltext?: Maybe>>;
+ _link?: Maybe;
+ _modified?: Maybe;
+ _score?: Maybe;
+};
+
+
+export type ArtistContainerPage_LinkArgs = {
+ type?: InputMaybe;
};
export type ArtistContainerPageAutocomplete = {
__typename?: 'ArtistContainerPageAutocomplete';
- Ancestors?: Maybe>>;
+ Ancestors?: Maybe>>;
Category?: Maybe;
ContentLink?: Maybe;
- ContentType?: Maybe>>;
+ ContentType?: Maybe>>;
ExistingLanguages?: Maybe;
Language?: Maybe;
MasterLanguage?: Maybe;
ParentLink?: Maybe;
- RelativePath?: Maybe>>;
- RouteSegment?: Maybe>>;
- Status?: Maybe>>;
- Url?: Maybe>>;
+ RelativePath?: Maybe>>;
+ RouteSegment?: Maybe>>;
+ SiteId?: Maybe>>;
+ Status?: Maybe>>;
+ Url?: Maybe>>;
};
export type ArtistContainerPageAutocompleteAncestorsArgs = {
- limit?: Scalars['Int'];
- value: Scalars['String'];
+ limit?: Scalars['Int']['input'];
+ value: Scalars['String']['input'];
};
export type ArtistContainerPageAutocompleteContentTypeArgs = {
- limit?: Scalars['Int'];
- value: Scalars['String'];
+ limit?: Scalars['Int']['input'];
+ value: Scalars['String']['input'];
};
export type ArtistContainerPageAutocompleteRelativePathArgs = {
- limit?: Scalars['Int'];
- value: Scalars['String'];
+ limit?: Scalars['Int']['input'];
+ value: Scalars['String']['input'];
};
export type ArtistContainerPageAutocompleteRouteSegmentArgs = {
- limit?: Scalars['Int'];
- value: Scalars['String'];
+ limit?: Scalars['Int']['input'];
+ value: Scalars['String']['input'];
+};
+
+
+export type ArtistContainerPageAutocompleteSiteIdArgs = {
+ limit?: Scalars['Int']['input'];
+ value: Scalars['String']['input'];
};
export type ArtistContainerPageAutocompleteStatusArgs = {
- limit?: Scalars['Int'];
- value: Scalars['String'];
+ limit?: Scalars['Int']['input'];
+ value: Scalars['String']['input'];
};
export type ArtistContainerPageAutocompleteUrlArgs = {
- limit?: Scalars['Int'];
- value: Scalars['String'];
+ limit?: Scalars['Int']['input'];
+ value: Scalars['String']['input'];
};
export type ArtistContainerPageFacet = {
@@ -132,6 +130,7 @@ export type ArtistContainerPageFacet = {
RelativePath?: Maybe>>;
RouteSegment?: Maybe>>;
Saved?: Maybe>>;
+ SiteId?: Maybe>>;
StartPublish?: Maybe>>;
Status?: Maybe>>;
StopPublish?: Maybe>>;
@@ -140,8 +139,8 @@ export type ArtistContainerPageFacet = {
export type ArtistContainerPageFacetAncestorsArgs = {
- filters?: InputMaybe>;
- limit?: Scalars['Int'];
+ filters?: InputMaybe>;
+ limit?: Scalars['Int']['input'];
orderBy?: InputMaybe;
orderType?: InputMaybe;
};
@@ -149,13 +148,13 @@ export type ArtistContainerPageFacetAncestorsArgs = {
export type ArtistContainerPageFacetChangedArgs = {
unit?: InputMaybe;
- value?: InputMaybe;
+ value?: InputMaybe;
};
export type ArtistContainerPageFacetContentTypeArgs = {
- filters?: InputMaybe>;
- limit?: Scalars['Int'];
+ filters?: InputMaybe>;
+ limit?: Scalars['Int']['input'];
orderBy?: InputMaybe;
orderType?: InputMaybe;
};
@@ -163,37 +162,37 @@ export type ArtistContainerPageFacetContentTypeArgs = {
export type ArtistContainerPageFacetCreatedArgs = {
unit?: InputMaybe;
- value?: InputMaybe;
+ value?: InputMaybe;
};
export type ArtistContainerPageFacetIsCommonDraftArgs = {
- filters?: InputMaybe>;
- limit?: Scalars['Int'];
+ filters?: InputMaybe>;
+ limit?: Scalars['Int']['input'];
orderBy?: InputMaybe;
orderType?: InputMaybe;
};
export type ArtistContainerPageFacetNameArgs = {
- filters?: InputMaybe>;
- limit?: Scalars['Int'];
+ filters?: InputMaybe>;
+ limit?: Scalars['Int']['input'];
orderBy?: InputMaybe;
orderType?: InputMaybe;
};
export type ArtistContainerPageFacetRelativePathArgs = {
- filters?: InputMaybe>;
- limit?: Scalars['Int'];
+ filters?: InputMaybe>;
+ limit?: Scalars['Int']['input'];
orderBy?: InputMaybe;
orderType?: InputMaybe;
};
export type ArtistContainerPageFacetRouteSegmentArgs = {
- filters?: InputMaybe>;
- limit?: Scalars['Int'];
+ filters?: InputMaybe>;
+ limit?: Scalars['Int']['input'];
orderBy?: InputMaybe;
orderType?: InputMaybe;
};
@@ -201,19 +200,27 @@ export type ArtistContainerPageFacetRouteSegmentArgs = {
export type ArtistContainerPageFacetSavedArgs = {
unit?: InputMaybe;
- value?: InputMaybe;
+ value?: InputMaybe;
+};
+
+
+export type ArtistContainerPageFacetSiteIdArgs = {
+ filters?: InputMaybe>;
+ limit?: Scalars['Int']['input'];
+ orderBy?: InputMaybe;
+ orderType?: InputMaybe;
};
export type ArtistContainerPageFacetStartPublishArgs = {
unit?: InputMaybe;
- value?: InputMaybe;
+ value?: InputMaybe;
};
export type ArtistContainerPageFacetStatusArgs = {
- filters?: InputMaybe>;
- limit?: Scalars['Int'];
+ filters?: InputMaybe>;
+ limit?: Scalars['Int']['input'];
orderBy?: InputMaybe;
orderType?: InputMaybe;
};
@@ -221,13 +228,13 @@ export type ArtistContainerPageFacetStatusArgs = {
export type ArtistContainerPageFacetStopPublishArgs = {
unit?: InputMaybe;
- value?: InputMaybe;
+ value?: InputMaybe;
};
export type ArtistContainerPageFacetUrlArgs = {
- filters?: InputMaybe>;
- limit?: Scalars['Int'];
+ filters?: InputMaybe>;
+ limit?: Scalars['Int']['input'];
orderBy?: InputMaybe;
orderType?: InputMaybe;
};
@@ -248,6 +255,7 @@ export type ArtistContainerPageOrderByInput = {
RelativePath?: InputMaybe;
RouteSegment?: InputMaybe;
Saved?: InputMaybe;
+ SiteId?: InputMaybe;
StartPublish?: InputMaybe;
Status?: InputMaybe;
StopPublish?: InputMaybe;
@@ -258,15 +266,15 @@ export type ArtistContainerPageOrderByInput = {
export type ArtistContainerPageOutput = {
__typename?: 'ArtistContainerPageOutput';
autocomplete?: Maybe;
- cursor?: Maybe;
+ cursor?: Maybe;
facets?: Maybe;
items?: Maybe>>;
- total?: Maybe;
+ total?: Maybe;
};
export type ArtistContainerPageOutputTotalArgs = {
- all?: InputMaybe;
+ all?: InputMaybe;
};
export type ArtistContainerPageWhereInput = {
@@ -285,6 +293,7 @@ export type ArtistContainerPageWhereInput = {
RelativePath?: InputMaybe;
RouteSegment?: InputMaybe;
Saved?: InputMaybe;
+ SiteId?: InputMaybe;
StartPublish?: InputMaybe;
Status?: InputMaybe;
StopPublish?: InputMaybe;
@@ -298,126 +307,140 @@ export type ArtistContainerPageWhereInput = {
export type ArtistDetailsPage = IContent & {
__typename?: 'ArtistDetailsPage';
- Ancestors?: Maybe>>;
+ Ancestors?: Maybe>>;
/** Description to appear on the artist detail page. */
- ArtistDescription?: Maybe;
- ArtistGenre?: Maybe;
- ArtistIsHeadliner?: Maybe;
- ArtistName?: Maybe;
- ArtistPhoto?: Maybe;
+ ArtistDescription?: Maybe;
+ ArtistGenre?: Maybe;
+ ArtistIsHeadliner?: Maybe;
+ ArtistName?: Maybe;
+ ArtistPhoto?: Maybe;
Category?: Maybe>>;
- Changed?: Maybe;
+ Changed?: Maybe;
ContentLink?: Maybe;
- ContentType?: Maybe>>;
- Created?: Maybe;
+ ContentType?: Maybe>>;
+ Created?: Maybe;
ExistingLanguages?: Maybe>>;
- IsCommonDraft?: Maybe;
+ IsCommonDraft?: Maybe;
Language?: Maybe;
MasterLanguage?: Maybe;
- Name?: Maybe;
+ Name?: Maybe;
ParentLink?: Maybe;
- PerformanceEndTime?: Maybe;
- PerformanceStartTime?: Maybe;
- RelativePath?: Maybe;
- RouteSegment?: Maybe;
- Saved?: Maybe;
- StageName?: Maybe;
- StartPublish?: Maybe;
- Status?: Maybe;
- StopPublish?: Maybe;
- Url?: Maybe;
+ PerformanceEndTime?: Maybe;
+ PerformanceStartTime?: Maybe;
+ RelativePath?: Maybe;
+ RouteSegment?: Maybe;
+ Saved?: Maybe;
+ SiteId?: Maybe;
+ StageName?: Maybe;
+ StartPublish?: Maybe;
+ Status?: Maybe;
+ StopPublish?: Maybe;
+ Url?: Maybe;
_children?: Maybe;
- _deleted?: Maybe;
- _fulltext?: Maybe>>;
- _modified?: Maybe;
- _score?: Maybe;
+ _deleted?: Maybe;
+ _fulltext?: Maybe>>;
+ _link?: Maybe;
+ _modified?: Maybe;
+ _score?: Maybe;
+};
+
+
+export type ArtistDetailsPage_LinkArgs = {
+ type?: InputMaybe;
};
export type ArtistDetailsPageAutocomplete = {
__typename?: 'ArtistDetailsPageAutocomplete';
- Ancestors?: Maybe>>;
- ArtistDescription?: Maybe>>;
- ArtistGenre?: Maybe>>;
- ArtistName?: Maybe>>;
- ArtistPhoto?: Maybe>>;
+ Ancestors?: Maybe>>;
+ ArtistDescription?: Maybe>>;
+ ArtistGenre?: Maybe>>;
+ ArtistName?: Maybe>>;
+ ArtistPhoto?: Maybe>>;
Category?: Maybe;
ContentLink?: Maybe;
- ContentType?: Maybe>>;
+ ContentType?: Maybe>>;
ExistingLanguages?: Maybe;
Language?: Maybe;
MasterLanguage?: Maybe;
ParentLink?: Maybe;
- RelativePath?: Maybe>>;
- RouteSegment?: Maybe>>;
- StageName?: Maybe>>;
- Status?: Maybe>>;
- Url?: Maybe>>;
+ RelativePath?: Maybe>>;
+ RouteSegment?: Maybe>>;
+ SiteId?: Maybe>>;
+ StageName?: Maybe>>;
+ Status?: Maybe>>;
+ Url?: Maybe>>;
};
export type ArtistDetailsPageAutocompleteAncestorsArgs = {
- limit?: Scalars['Int'];
- value: Scalars['String'];
+ limit?: Scalars['Int']['input'];
+ value: Scalars['String']['input'];
};
export type ArtistDetailsPageAutocompleteArtistDescriptionArgs = {
- limit?: Scalars['Int'];
- value: Scalars['String'];
+ limit?: Scalars['Int']['input'];
+ value: Scalars['String']['input'];
};
export type ArtistDetailsPageAutocompleteArtistGenreArgs = {
- limit?: Scalars['Int'];
- value: Scalars['String'];
+ limit?: Scalars['Int']['input'];
+ value: Scalars['String']['input'];
};
export type ArtistDetailsPageAutocompleteArtistNameArgs = {
- limit?: Scalars['Int'];
- value: Scalars['String'];
+ limit?: Scalars['Int']['input'];
+ value: Scalars['String']['input'];
};
export type ArtistDetailsPageAutocompleteArtistPhotoArgs = {
- limit?: Scalars['Int'];
- value: Scalars['String'];
+ limit?: Scalars['Int']['input'];
+ value: Scalars['String']['input'];
};
export type ArtistDetailsPageAutocompleteContentTypeArgs = {
- limit?: Scalars['Int'];
- value: Scalars['String'];
+ limit?: Scalars['Int']['input'];
+ value: Scalars['String']['input'];
};
export type ArtistDetailsPageAutocompleteRelativePathArgs = {
- limit?: Scalars['Int'];
- value: Scalars['String'];
+ limit?: Scalars['Int']['input'];
+ value: Scalars['String']['input'];
};
export type ArtistDetailsPageAutocompleteRouteSegmentArgs = {
- limit?: Scalars['Int'];
- value: Scalars['String'];
+ limit?: Scalars['Int']['input'];
+ value: Scalars['String']['input'];
+};
+
+
+export type ArtistDetailsPageAutocompleteSiteIdArgs = {
+ limit?: Scalars['Int']['input'];
+ value: Scalars['String']['input'];
};
export type ArtistDetailsPageAutocompleteStageNameArgs = {
- limit?: Scalars['Int'];
- value: Scalars['String'];
+ limit?: Scalars['Int']['input'];
+ value: Scalars['String']['input'];
};
export type ArtistDetailsPageAutocompleteStatusArgs = {
- limit?: Scalars['Int'];
- value: Scalars['String'];
+ limit?: Scalars['Int']['input'];
+ value: Scalars['String']['input'];
};
export type ArtistDetailsPageAutocompleteUrlArgs = {
- limit?: Scalars['Int'];
- value: Scalars['String'];
+ limit?: Scalars['Int']['input'];
+ value: Scalars['String']['input'];
};
export type ArtistDetailsPageFacet = {
@@ -444,6 +467,7 @@ export type ArtistDetailsPageFacet = {
RelativePath?: Maybe>>;
RouteSegment?: Maybe>>;
Saved?: Maybe>>;
+ SiteId?: Maybe>>;
StageName?: Maybe>>;
StartPublish?: Maybe