File tree Expand file tree Collapse file tree 2 files changed +9
-13
lines changed Expand file tree Collapse file tree 2 files changed +9
-13
lines changed Original file line number Diff line number Diff line change 1
- import { kindeConfiguration } from '$lib/config/index.js' ;
1
+ import { kindeConfiguration , kindeAPIConfiguration } from '$lib/config/index.js' ;
2
2
import { sessionStorage } from '$lib/sessionStorage/index.js' ;
3
3
4
4
import {
@@ -24,12 +24,7 @@ export const kindeAuthClient = createKindeServerClient(
24
24
export const getHeaders = async ( ) => {
25
25
const kindeManagementApi = createKindeServerClient (
26
26
GrantType . CLIENT_CREDENTIALS ,
27
- omit ( kindeConfiguration , [
28
- 'logoutRedirectURL' ,
29
- 'loginRedirectURL' ,
30
- 'scope' ,
31
- 'redirectURL'
32
- ] ) as unknown as CCClientOptions
27
+ kindeAPIConfiguration as unknown as CCClientOptions
33
28
) ;
34
29
35
30
const token = await kindeManagementApi . getToken ( sessionStorage as unknown as SessionManager ) ;
@@ -43,12 +38,7 @@ export const getHeaders = async () => {
43
38
export const getConfiguration = async ( configurationOverrides ?: ConfigurationParameters ) => {
44
39
const kindeManagementApi = createKindeServerClient (
45
40
GrantType . CLIENT_CREDENTIALS ,
46
- omit ( kindeConfiguration , [
47
- 'logoutRedirectURL' ,
48
- 'loginRedirectURL' ,
49
- 'scope' ,
50
- 'redirectURL'
51
- ] ) as unknown as CCClientOptions
41
+ kindeAPIConfiguration as unknown as CCClientOptions
52
42
) ;
53
43
54
44
const token = await kindeManagementApi . getToken ( sessionStorage as unknown as SessionManager ) ;
Original file line number Diff line number Diff line change @@ -13,3 +13,9 @@ export const kindeConfiguration = {
13
13
loginRedirectURL : env . KINDE_POST_LOGIN_REDIRECT_URL ,
14
14
authUsePKCE : [ true , 'true' ] . includes ( env . KINDE_AUTH_WITH_PKCE )
15
15
} ;
16
+
17
+ export const kindeAPIConfiguration = {
18
+ audience : `${ env . KINDE_ISSUER_URL } /api` ,
19
+ clientId : env . KINDE_CLIENT_ID ,
20
+ clientSecret : env . KINDE_CLIENT_SECRET
21
+ } ;
You can’t perform that action at this time.
0 commit comments