File tree Expand file tree Collapse file tree 2 files changed +14
-8
lines changed
app/api/auth/[...nextauth] Expand file tree Collapse file tree 2 files changed +14
-8
lines changed Original file line number Diff line number Diff line change @@ -11,11 +11,12 @@ import KeycloakProvider from "next-auth/providers/keycloak"
11
11
import { NextAuthOptions } from 'next-auth'
12
12
import { jwtDecode } from 'jwt-decode'
13
13
import { UserGroupType } from '@/object-types'
14
+ import { SW360_KEYCLOAK_CLIENT_ID , SW360_KEYCLOAK_CLIENT_SECRET , AUTH_ISSUER } from '@/utils/env'
14
15
15
16
const keycloakProvider = KeycloakProvider ( {
16
- clientId : ` ${ process . env . SW360_KEYCLOAK_CLIENT_ID } ` ,
17
- clientSecret : ` ${ process . env . SW360_KEYCLOAK_CLIENT_SECRET } ` ,
18
- issuer : ` ${ process . env . AUTH_ISSUER } ` ,
17
+ clientId : SW360_KEYCLOAK_CLIENT_ID ,
18
+ clientSecret : SW360_KEYCLOAK_CLIENT_SECRET ,
19
+ issuer : AUTH_ISSUER ,
19
20
checks : 'state' ,
20
21
authorization : { params : { scope : "openid READ WRITE" } } ,
21
22
} )
@@ -79,4 +80,4 @@ function getUserGroup(tokenDetails: { userGroup?: string[] }): UserGroupType[] {
79
80
} ) : [ UserGroupType . USER ] ;
80
81
}
81
82
82
- export default keycloakAuthOption ;
83
+ export default keycloakAuthOption ;
Original file line number Diff line number Diff line change 9
9
// SPDX-License-Identifier: EPL-2.0
10
10
// License-Filename: LICENSE
11
11
12
- export const SW360_API_URL : string | undefined = process . env . NEXT_PUBLIC_SW360_API_URL ;
13
- export const AUTH_TOKEN : string | undefined = process . env . NEXT_PUBLIC_AUTH_TOKEN ;
14
- export const SW360_REST_CLIENT_ID : string | undefined = process . env . NEXT_PUBLIC_SW360_REST_CLIENT_ID ;
15
- export const SW360_REST_CLIENT_SECRET : string | undefined = process . env . NEXT_PUBLIC_SW360_REST_CLIENT_SECRET ;
12
+ // Server/Client side env
13
+ export const SW360_API_URL : string | undefined = process . env . NEXT_PUBLIC_SW360_API_URL ;
16
14
export const AUTH_PROVIDER : string | undefined = process . env . NEXT_PUBLIC_SW360_AUTH_PROVIDER ;
15
+
16
+ // Server side env
17
+ export const SW360_REST_CLIENT_ID : string | undefined = process . env . SW360_REST_CLIENT_ID ;
18
+ export const SW360_REST_CLIENT_SECRET : string | undefined = process . env . SW360_REST_CLIENT_SECRET ;
19
+ export const SW360_KEYCLOAK_CLIENT_ID = `${ process . env . SW360_KEYCLOAK_CLIENT_ID } ` ;
20
+ export const SW360_KEYCLOAK_CLIENT_SECRET = `${ process . env . SW360_KEYCLOAK_CLIENT_SECRET } ` ;
21
+ export const AUTH_ISSUER : string | undefined = process . env . AUTH_ISSUER ;
You can’t perform that action at this time.
0 commit comments