@ahhaohho/auth-middleware 1.0.3 → 1.0.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ahhaohho/auth-middleware",
3
- "version": "1.0.3",
3
+ "version": "1.0.4",
4
4
  "description": "Shared authentication middleware with Passport.js for ahhaohho microservices",
5
5
  "main": "src/index.js",
6
6
  "scripts": {
@@ -160,6 +160,8 @@ async function authenticateHybrid(req, res, next) {
160
160
 
161
161
  // 3. Refresh token 검증
162
162
  passport.authenticate('refresh', { session: false }, async (refreshErr, refreshUser, refreshInfo) => {
163
+ console.log('[@ahhaohho/auth-middleware] 🔍 Refresh callback:', { hasError: !!refreshErr, hasUser: !!refreshUser, userId: refreshUser?.userId });
164
+
163
165
  if (refreshErr) {
164
166
  console.error('[@ahhaohho/auth-middleware] Refresh token error:', refreshErr.message);
165
167
  return res.status(500).json({
@@ -169,6 +171,7 @@ async function authenticateHybrid(req, res, next) {
169
171
  }
170
172
 
171
173
  if (!refreshUser) {
174
+ console.error('[@ahhaohho/auth-middleware] ❌ No refresh user found, returning 401');
172
175
  return res.status(401).json({
173
176
  error: 'Unauthorized',
174
177
  message: 'Both access and refresh tokens are invalid'