feat(WEB-169): get profile data from API
This commit is contained in:
@@ -14,17 +14,16 @@ export const publicProcedure = t.procedure
|
||||
export const protectedProcedure = t.procedure.use(async function (opts) {
|
||||
const authRequired = opts.meta?.authRequired ?? true
|
||||
const session = await opts.ctx.auth()
|
||||
if (authRequired) {
|
||||
if (!session?.user) {
|
||||
throw unauthorizedError()
|
||||
}
|
||||
} else {
|
||||
if (env.NODE_ENV === "development") {
|
||||
console.info(
|
||||
`❌❌❌❌ You are opting out of authorization, if its done on purpose maybe you should use the publicProcedure instead. ❌❌❌❌`
|
||||
)
|
||||
console.info(`path: ${opts.path} | type: ${opts.type}`)
|
||||
}
|
||||
|
||||
if (!authRequired && env.NODE_ENV === "development") {
|
||||
console.info(
|
||||
`❌❌❌❌ You are opting out of authorization, if its done on purpose maybe you should use the publicProcedure instead. ❌❌❌❌`
|
||||
)
|
||||
console.info(`path: ${opts.path} | type: ${opts.type}`)
|
||||
}
|
||||
|
||||
if (!session?.user) {
|
||||
throw unauthorizedError()
|
||||
}
|
||||
|
||||
return opts.next({
|
||||
|
||||
Reference in New Issue
Block a user