@@ -68,20 +68,14 @@ oidcRouter.get('/dlrg/callback', async (c) => {
6868 Authorization : `Bearer ${ result . access_token } ` ,
6969 } ,
7070 } )
71- const profileRaw = await userInfoResponse . json ( )
71+ const profileRaw = await userInfoResponse . json ( ) as Record < string , unknown >
7272 const profile = ZProfile . parse ( profileRaw )
7373 const existingUser = await prisma . account . findUnique ( {
7474 where : {
7575 dlrgOauthId : profile . sub ,
7676 } ,
7777 } )
7878
79- let registerAsGliederung = false
80- const registerAs = c . req . query ( 'as' ) ?. trim ( )
81- if ( registerAs !== undefined && registerAs ?. length > 0 ) {
82- registerAsGliederung = true
83- }
84-
8579 let account : Account
8680
8781 // if user exists, return jwt
@@ -105,8 +99,8 @@ oidcRouter.get('/dlrg/callback', async (c) => {
10599 dlrgOauthId : profile . sub ,
106100 email : profile . email ,
107101 password : '' ,
108- role : registerAsGliederung ? 'GLIEDERUNG_ADMIN' : 'USER' ,
109- status : registerAsGliederung ? 'OFFEN' : 'AKTIV' ,
102+ role : 'USER' ,
103+ status : 'AKTIV' ,
110104 activatedAt : new Date ( ) ,
111105 person : {
112106 create : {
@@ -120,9 +114,7 @@ oidcRouter.get('/dlrg/callback', async (c) => {
120114 } )
121115 }
122116
123- // TODO: Implement onboarding
124- const redirectUri = new URL ( registerAsGliederung ? '/onboarding' : '/login' , config . clientUrl )
125-
117+ const redirectUri = new URL ( '/login' , config . clientUrl )
126118 const jwt = sign ( {
127119 sub : account . id . toString ( ) ,
128120 } )
0 commit comments