Skip to content

Commit 9618920

Browse files
authored
Merge pull request #178 from import-ai/refactor/user
refactor(user): update user interceptor
2 parents c52f0c7 + c155844 commit 9618920

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/interceptor/user.interceptor.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@ import { Observable } from 'rxjs';
88
import { tap, finalize } from 'rxjs/operators';
99
import { trace, context } from '@opentelemetry/api';
1010

11+
const LOGIN_URLS = ['/api/v1/login', '/api/v1/sign-up/confirm'];
12+
1113
@Injectable()
1214
export class UserInterceptor implements NestInterceptor {
1315
intercept(
@@ -27,7 +29,7 @@ export class UserInterceptor implements NestInterceptor {
2729
if (req.user?.id) {
2830
span.setAttribute('user.id', req.user.id);
2931
} else if (
30-
req.url === '/api/v1/login' &&
32+
LOGIN_URLS.includes(req.url) &&
3133
req.method === 'POST' &&
3234
responseBody?.id
3335
) {

0 commit comments

Comments
 (0)