File tree Expand file tree Collapse file tree 2 files changed +5
-15
lines changed
Expand file tree Collapse file tree 2 files changed +5
-15
lines changed Original file line number Diff line number Diff line change @@ -20,9 +20,7 @@ async function authPlugin(fastify) {
2020 mcpIssuerConfiguration . authorizationEndpoint ,
2121 ) ;
2222
23- reply . redirect ( redirectUri ) ;
24-
25- return reply ;
23+ return reply . redirect ( redirectUri ) ;
2624 } ) ;
2725
2826 fastify . get ( '/auth/mcp/callback' , async ( req , reply ) => {
@@ -45,7 +43,7 @@ async function authPlugin(fastify) {
4543 req . encryptedSession . delete ( 'mcp_tokenExpiresAt' ) ;
4644 }
4745
48- reply . redirect ( POST_LOGIN_REDIRECT + callbackResult . postLoginRedirectRoute ) ;
46+ return reply . redirect ( POST_LOGIN_REDIRECT + callbackResult . postLoginRedirectRoute ) ;
4947 } catch ( error ) {
5048 if ( error instanceof AuthenticationError ) {
5149 req . log . error ( 'AuthenticationError during OIDC callback: %s' , error ) ;
@@ -54,8 +52,6 @@ async function authPlugin(fastify) {
5452 throw error ;
5553 }
5654 }
57-
58- return reply ;
5955 } ) ;
6056
6157 fastify . get ( '/auth/mcp/me' , async ( req , reply ) => {
Original file line number Diff line number Diff line change @@ -43,7 +43,7 @@ async function authPlugin(fastify) {
4343 req . encryptedSession . delete ( 'onboarding_tokenExpiresAt' ) ;
4444 }
4545
46- reply . redirect ( POST_LOGIN_REDIRECT + callbackResult . postLoginRedirectRoute ) ;
46+ return reply . redirect ( POST_LOGIN_REDIRECT + callbackResult . postLoginRedirectRoute ) ;
4747 } catch ( error ) {
4848 if ( error instanceof AuthenticationError ) {
4949 req . log . error ( 'AuthenticationError during OIDC callback: %s' , error ) ;
@@ -52,8 +52,6 @@ async function authPlugin(fastify) {
5252 throw error ;
5353 }
5454 }
55-
56- return reply ;
5755 } ) ;
5856
5957 fastify . get ( '/auth/onboarding/me' , async ( req , reply ) => {
@@ -62,17 +60,13 @@ async function authPlugin(fastify) {
6260
6361 const isAuthenticated = Boolean ( accessToken ) ;
6462 const user = isAuthenticated ? userInfo : null ;
65- reply . send ( { isAuthenticated, user } ) ;
66-
67- return reply ;
63+ return reply . send ( { isAuthenticated, user } ) ;
6864 } ) ;
6965
7066 fastify . post ( '/auth/logout' , async ( req , reply ) => {
7167 // TODO: Idp sign out flow
7268 req . encryptedSession . clear ( ) ;
73- reply . send ( { message : 'Logged out' } ) ;
74-
75- return reply ;
69+ return reply . send ( { message : 'Logged out' } ) ;
7670 } ) ;
7771}
7872
You can’t perform that action at this time.
0 commit comments