Throw an UnauthorizedError in an intent handler to make the library
respond with a HTTP 401 Status Code.
example
const app = dialogflow()
// If using Actions SDK:// const app = actionssdk()
app.intent('intent', conv => {
// ...// given a function to check if a user auth is still validconst valid = checkUserAuthValid(conv)
if (!valid) {
thrownew UnauthorizedError()
}
// ...
})
example
const app = dialogflow()
// If using Actions SDK:// const app = actionssdk()
app.intent('intent', conv => {
// ...// given a function to check if a user auth is still validconst valid = checkUserAuthValid(conv)
if (!valid) {
thrownew UnauthorizedError()
}
// ...
})
Throw an UnauthorizedError in an intent handler to make the library respond with a HTTP 401 Status Code.
const app = dialogflow() // If using Actions SDK: // const app = actionssdk() app.intent('intent', conv => { // ... // given a function to check if a user auth is still valid const valid = checkUserAuthValid(conv) if (!valid) { throw new UnauthorizedError() } // ... })
const app = dialogflow() // If using Actions SDK: // const app = actionssdk() app.intent('intent', conv => { // ... // given a function to check if a user auth is still valid const valid = checkUserAuthValid(conv) if (!valid) { throw new UnauthorizedError() } // ... })