@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 +1 -1
- package/src/middleware/auth.js +3 -0
package/package.json
CHANGED
package/src/middleware/auth.js
CHANGED
|
@@ -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'
|