Debug: Agregar logs para investigar usuario no encontrado
All checks were successful
build-and-deploy / build-and-deploy (push) Successful in 55s
All checks were successful
build-and-deploy / build-and-deploy (push) Successful in 55s
This commit is contained in:
@@ -31,6 +31,9 @@ export default defineEventHandler(async (event) => {
|
|||||||
try {
|
try {
|
||||||
if (method === 'GET') {
|
if (method === 'GET') {
|
||||||
// GET: Obtener información del usuario
|
// GET: Obtener información del usuario
|
||||||
|
console.log('🔍 Buscando usuario con username:', username)
|
||||||
|
console.log('🌐 URL de Authentik:', authentikUrl)
|
||||||
|
|
||||||
const response = await $fetch(`${authentikUrl}/api/v3/core/users/?username=${username}`, {
|
const response = await $fetch(`${authentikUrl}/api/v3/core/users/?username=${username}`, {
|
||||||
headers: {
|
headers: {
|
||||||
'Authorization': `Bearer ${authentikToken}`,
|
'Authorization': `Bearer ${authentikToken}`,
|
||||||
@@ -39,6 +42,7 @@ export default defineEventHandler(async (event) => {
|
|||||||
})
|
})
|
||||||
|
|
||||||
const users = response as any
|
const users = response as any
|
||||||
|
console.log('📊 Respuesta de Authentik:', JSON.stringify(users, null, 2))
|
||||||
|
|
||||||
if (!users.results || users.results.length === 0) {
|
if (!users.results || users.results.length === 0) {
|
||||||
throw createError({
|
throw createError({
|
||||||
|
|||||||
Reference in New Issue
Block a user