Merged in fix/improve-sas-error-logging (pull request #1854)
Improve SAS flow logging * Improve logging Approved-by: Joakim Jäderberg
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
import * as Sentry from "@sentry/nextjs"
|
||||
import { TRPCError } from "@trpc/server"
|
||||
import { cookies } from "next/headers"
|
||||
import { v4 as uuidv4 } from "uuid"
|
||||
@@ -43,7 +44,6 @@ export const requestOtp = protectedProcedure
|
||||
const sasAuthToken = getSasToken()
|
||||
|
||||
if (!sasAuthToken) {
|
||||
// TODO: Should we verify that the SAS token isn't expired?
|
||||
throw createError("AUTH_TOKEN_NOT_FOUND")
|
||||
}
|
||||
|
||||
@@ -67,6 +67,10 @@ export const requestOtp = protectedProcedure
|
||||
|
||||
if (parseResult.data.status === "SENT") {
|
||||
setSASOtpCookie(parseResult.data)
|
||||
} else {
|
||||
const sasRequestOtpErrorMessage = `[SAS] requestOtp did not return SENT status with body: ${body}`
|
||||
console.warn(sasRequestOtpErrorMessage)
|
||||
Sentry.captureMessage(sasRequestOtpErrorMessage)
|
||||
}
|
||||
|
||||
return parseResult.data
|
||||
|
||||
Reference in New Issue
Block a user