Skip to content

Commit 9dcde7a

Browse files
committed
fix: update AsgardeoServerProviderProps to use Partial<AsgardeoProviderProps> and improve type safety
chore: exclude teamspace-nextjs from pnpm workspace packages
1 parent 12d269d commit 9dcde7a

File tree

2 files changed

+7
-5
lines changed

2 files changed

+7
-5
lines changed

packages/nextjs/src/server/AsgardeoProvider.tsx

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -29,11 +29,12 @@ import getSessionId from './actions/getSessionId';
2929
import getUserProfileAction from './actions/getUserProfileAction';
3030
import signUpAction from './actions/signUpAction';
3131
import handleOAuthCallbackAction from './actions/handleOAuthCallbackAction';
32+
import {AsgardeoProviderProps} from '@asgardeo/react';
3233

3334
/**
3435
* Props interface of {@link AsgardeoServerProvider}
3536
*/
36-
export type AsgardeoServerProviderProps = AsgardeoClientProviderProps & {
37+
export type AsgardeoServerProviderProps = Partial<AsgardeoProviderProps> & {
3738
clientSecret?: string;
3839
};
3940

@@ -63,7 +64,7 @@ const AsgardeoServerProvider: FC<PropsWithChildren<AsgardeoServerProviderProps>>
6364
let config: Partial<AsgardeoNextConfig> = {};
6465

6566
try {
66-
await asgardeoClient.initialize(_config);
67+
await asgardeoClient.initialize(_config as AsgardeoNextConfig);
6768
config = await asgardeoClient.getConfiguration();
6869
} catch (error) {
6970
throw new AsgardeoRuntimeError(
@@ -78,7 +79,7 @@ const AsgardeoServerProvider: FC<PropsWithChildren<AsgardeoServerProviderProps>>
7879
return <></>;
7980
}
8081

81-
const sessionId: string = await getSessionId() as string;
82+
const sessionId: string = (await getSessionId()) as string;
8283
const _isSignedIn: boolean = await isSignedIn(sessionId);
8384

8485
let user: User = {};
@@ -89,8 +90,8 @@ const AsgardeoServerProvider: FC<PropsWithChildren<AsgardeoServerProviderProps>>
8990
};
9091

9192
if (_isSignedIn) {
92-
const userResponse = await getUserAction((sessionId));
93-
const userProfileResponse = await getUserProfileAction((sessionId));
93+
const userResponse = await getUserAction(sessionId);
94+
const userProfileResponse = await getUserProfileAction(sessionId);
9495

9596
user = userResponse.data?.user || {};
9697
userProfile = userProfileResponse.data?.userProfile;

pnpm-workspace.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ packages:
55
- '!packages/__legacy__'
66
- 'samples/*'
77
- '!samples/__legacy__/*'
8+
- '!samples/teamspace-nextjs'
89

910
catalog:
1011
'@wso2/eslint-plugin': 'https://gitpkg.now.sh/brionmario/wso2-ui-configs/packages/eslint-plugin?a1fc6eb570653c999828aea9f5027cba06af4391'

0 commit comments

Comments
 (0)