@@ -88,16 +88,16 @@ const oauthController: FastifyPluginAsync<Options> = async (server, opts) => {
8888 return reply . code ( 204 ) . send ( ) ;
8989 } ) ;
9090
91- server . post < { Body : { configId : string ; code : string ; codeVerifier ?: string ; redirectUri : string } } > (
91+ server . post < { Body : { configId : string ; code : string ; codeVerifier ?: string ; redirectUri : string ; insecureTls ?: boolean } } > (
9292 '/oauth/token' ,
9393 async ( request , reply ) => {
94- const { configId, code, codeVerifier, redirectUri } = request . body ;
94+ const { configId, code, codeVerifier, redirectUri, insecureTls } = request . body ;
9595 if ( ! configId || ! code || ! redirectUri ) {
9696 return reply . code ( 400 ) . send ( { error : 'Missing required fields: configId, code, redirectUri' } ) ;
9797 }
9898
9999 try {
100- const result = await oauthService . exchangeToken ( { configId, code, codeVerifier, redirectUri } ) ;
100+ const result = await oauthService . exchangeToken ( { configId, code, codeVerifier, redirectUri, insecureTls } ) ;
101101 return reply . code ( 200 ) . send ( result ) ;
102102 } catch ( error ) {
103103 if ( axios . isAxiosError ( error ) ) {
@@ -111,16 +111,16 @@ const oauthController: FastifyPluginAsync<Options> = async (server, opts) => {
111111 } ,
112112 ) ;
113113
114- server . post < { Body : { configId : string ; refreshToken : string } } > (
114+ server . post < { Body : { configId : string ; refreshToken : string ; insecureTls ?: boolean } } > (
115115 '/oauth/refresh' ,
116116 async ( request , reply ) => {
117- const { configId, refreshToken } = request . body ;
117+ const { configId, refreshToken, insecureTls } = request . body ;
118118 if ( ! configId || ! refreshToken ) {
119119 return reply . code ( 400 ) . send ( { error : 'Missing required fields: configId, refreshToken' } ) ;
120120 }
121121
122122 try {
123- const result = await oauthService . refreshToken ( { configId, refreshToken } ) ;
123+ const result = await oauthService . refreshToken ( { configId, refreshToken, insecureTls } ) ;
124124 return reply . code ( 200 ) . send ( result ) ;
125125 } catch ( error ) {
126126 if ( axios . isAxiosError ( error ) ) {
@@ -134,16 +134,16 @@ const oauthController: FastifyPluginAsync<Options> = async (server, opts) => {
134134 } ,
135135 ) ;
136136
137- server . post < { Body : { configId : string ; token : string ; tokenTypeHint ?: string } } > (
137+ server . post < { Body : { configId : string ; token : string ; tokenTypeHint ?: string ; insecureTls ?: boolean } } > (
138138 '/oauth/revoke' ,
139139 async ( request , reply ) => {
140- const { configId, token, tokenTypeHint } = request . body ;
140+ const { configId, token, tokenTypeHint, insecureTls } = request . body ;
141141 if ( ! configId || ! token ) {
142142 return reply . code ( 400 ) . send ( { error : 'Missing required fields: configId, token' } ) ;
143143 }
144144
145145 try {
146- const result = await oauthService . revokeToken ( { configId, token, tokenTypeHint } ) ;
146+ const result = await oauthService . revokeToken ( { configId, token, tokenTypeHint, insecureTls } ) ;
147147 return reply . code ( 200 ) . send ( result ) ;
148148 } catch ( error ) {
149149 if ( axios . isAxiosError ( error ) ) {
@@ -157,14 +157,14 @@ const oauthController: FastifyPluginAsync<Options> = async (server, opts) => {
157157 } ,
158158 ) ;
159159
160- server . post < { Body : { configId : string } } > ( '/oauth/client-credentials' , async ( request , reply ) => {
161- const { configId } = request . body ;
160+ server . post < { Body : { configId : string ; insecureTls ?: boolean } } > ( '/oauth/client-credentials' , async ( request , reply ) => {
161+ const { configId, insecureTls } = request . body ;
162162 if ( ! configId ) {
163163 return reply . code ( 400 ) . send ( { error : 'Missing required field: configId' } ) ;
164164 }
165165
166166 try {
167- const result = await oauthService . clientCredentials ( configId ) ;
167+ const result = await oauthService . clientCredentials ( { configId, insecureTls } ) ;
168168 return reply . code ( 200 ) . send ( result ) ;
169169 } catch ( error ) {
170170 if ( axios . isAxiosError ( error ) ) {
@@ -177,16 +177,16 @@ const oauthController: FastifyPluginAsync<Options> = async (server, opts) => {
177177 }
178178 } ) ;
179179
180- server . post < { Body : { configId : string ; username : string ; password : string } } > (
180+ server . post < { Body : { configId : string ; username : string ; password : string ; insecureTls ?: boolean } } > (
181181 '/oauth/password' ,
182182 async ( request , reply ) => {
183- const { configId, username, password } = request . body ;
183+ const { configId, username, password, insecureTls } = request . body ;
184184 if ( ! configId || ! username || ! password ) {
185185 return reply . code ( 400 ) . send ( { error : 'Missing required fields: configId, username, password' } ) ;
186186 }
187187
188188 try {
189- const result = await oauthService . passwordFlow ( { configId, username, password } ) ;
189+ const result = await oauthService . passwordFlow ( { configId, username, password, insecureTls } ) ;
190190 return reply . code ( 200 ) . send ( result ) ;
191191 } catch ( error ) {
192192 if ( axios . isAxiosError ( error ) ) {
0 commit comments