File tree Expand file tree Collapse file tree 2 files changed +13
-3
lines changed Expand file tree Collapse file tree 2 files changed +13
-3
lines changed Original file line number Diff line number Diff line change @@ -313,6 +313,9 @@ export const renderCustomerContextScreen = async (
313313 oauthReqInfo : AuthRequest | null ,
314314 apiKey : string
315315) => {
316+ if ( action === "reject" ) {
317+ return renderAuthorizationRejectedContent ( oauthReqInfo ?. redirectUri || "/" ) ;
318+ }
316319 return html `
317320 < div class ="max-w-md mx-auto bg-white p-8 rounded-lg shadow-md ">
318321 < h1 class ="text-2xl font-heading font-bold mb-6 text-gray-900 ">
Original file line number Diff line number Diff line change 55 formatZodError ,
66 handleGeneralError ,
77} from "../utils/util.js" ;
8+ import { handleValidateUserRequest } from "./validateUser.js" ;
89
910// Schema definition
1011export const ChangeCustomerArgumentsSchema = z . object ( {
@@ -57,14 +58,20 @@ export async function handleChangeCustomerRequest(
5758 await updateCustomerContext ( newContext ) ;
5859 }
5960
61+ // Verify that the new context is valid
62+ const newCustomerDomain = await handleValidateUserRequest (
63+ { customerContext : newContext } , // Validate doers
64+ token
65+ ) ;
66+
67+ const domain = newCustomerDomain . content [ 0 ] . text . split ( "Domain: " ) [ 1 ] ;
68+
6069 // Create response
6170 const response : ChangeCustomerResponse = {
6271 success : true ,
6372 previousContext,
6473 newContext,
65- message : `Customer context successfully changed${
66- previousContext ? ` from '${ previousContext } '` : ""
67- } to '${ newContext } '`,
74+ message : `Customer context successfully changed to '${ domain } '` ,
6875 } ;
6976
7077 return createSuccessResponse ( response . message ) ;
You can’t perform that action at this time.
0 commit comments