Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,15 @@ export const useCIBA = auth0AI.withAsyncUserConfirmation({
*
* For a more real world scenario refer to `demos/vercel-ai-agent`.
*/
onAuthorizationRequest: "block",
onAuthorizationRequest: async (authReq, creds) => {
console.log(`An authorization request was sent to your mobile device or your email.`);
await creds;
console.log(`Thanks for approving the order.`);
},

onUnauthorized: async (e: Error) => {
if (e instanceof AccessDeniedInterrupt) {
return "The user has deny the request";
return "The user has denied the request";
}
return e.message;
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,7 @@ export const useDeviceFLow = new Auth0AI({
type: "confirm",
name: "answer",
initial: true,
message:
"We need to authenticate you in a browser. Do you want to continue?",
message: `We need to authenticate you in a browser. You will be taken to a login page where this code will be prefilled: ${request.userCode}. Do you want to continue?`,
});
if (!answer) {
process.exit(1);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,14 +36,14 @@ export const useCIBA = auth0AI.withAsyncUserConfirmation({
* For a more real world scenario refer to `demos/vercel-ai-agent`.
*/
onAuthorizationRequest: async (authReq, creds) => {
console.log(`An authorization request was sent to your mobile device.`);
console.log(`An authorization request was sent to your mobile device or your email.`);
await creds;
console.log(`Thanks for approving the order.`);
},

onUnauthorized: async (e: Error) => {
if (e instanceof AccessDeniedInterrupt) {
return "The user has deny the request";
return "The user has denied the request";
}
return e.message;
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,7 @@ export const useDeviceFLow = new Auth0AI({
type: "confirm",
name: "answer",
initial: true,
message:
"We need to authenticate you in a browser. Do you want to continue?",
message: `We need to authenticate you in a browser. You will be taken to a login page where this code will be prefilled: ${request.userCode}. Do you want to continue?`,
});
if (!answer) {
throw new Error("User denied the request");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,14 +32,14 @@ export const useCIBA = auth0AI.withAsyncUserConfirmation({
* For a more real world scenario refer to `demos/vercel-ai-agent`.
*/
onAuthorizationRequest: async (authReq, creds) => {
console.log(`An authorization request was sent to your mobile device.`);
console.log(`An authorization request was sent to your mobile device or your email.`);
await creds;
console.log(`Thanks for approving the order.`);
},

onUnauthorized: async (e: Error) => {
if (e instanceof AccessDeniedInterrupt) {
return "The user has deny the request";
return "The user has denied the request";
}
return e.message;
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,7 @@ export const useDeviceFlow = new Auth0AI({
type: "confirm",
name: "answer",
initial: true,
message:
"We need to authenticate you in a browser. Do you want to continue?",
message: `We need to authenticate you in a browser. You will be taken to a login page where this code will be prefilled: ${request.userCode}. Do you want to continue?`,
});
if (!answer) {
throw new Error("User denied the request");
Expand Down