chore: remove invalidateSession

This commit is contained in:
Matilda Landström
2024-05-22 10:37:20 +02:00
parent dec41fa477
commit eeceddc545
3 changed files with 0 additions and 33 deletions

View File

@@ -21,36 +21,6 @@ function fakingRequest<T>(payload: T): Promise<T> {
}
export const userQueryRouter = router({
invalidateSessions: protectedProcedure.query(async function ({ ctx }) {
try {
const apiResponse = await api.post(api.endpoints.v1.invalidateSessions, {
cache: "no-store",
headers: {
Authorization: `Bearer ${ctx.session.token.access_token}`,
},
body: {},
})
if (!apiResponse.ok) {
switch (apiResponse.status) {
case 400:
throw badRequestError(apiResponse)
case 401:
throw unauthorizedError(apiResponse)
case 403:
throw forbiddenError(apiResponse)
default:
throw internalServerError(apiResponse)
}
}
return true
} catch (error) {
console.info(`Invalidate Sessions Error`)
console.error(error)
throw internalServerError()
}
}),
get: protectedProcedure.query(async function ({ ctx }) {
const apiResponse = await api.get(api.endpoints.v1.profile, {
cache: "no-store",