Skip to content

Commit 6a8038d

Browse files
committed
[feat]: auth interceptor 추가
1 parent 40d6049 commit 6a8038d

1 file changed

Lines changed: 18 additions & 0 deletions

File tree

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
package com.texthip.thip.utils.auth
2+
3+
import okhttp3.Interceptor
4+
import okhttp3.Response
5+
import javax.inject.Inject
6+
7+
class AuthInterceptor @Inject constructor() : Interceptor {
8+
override fun intercept(chain: Interceptor.Chain): Response {
9+
val request = chain.request().newBuilder()
10+
11+
request
12+
.addHeader(
13+
"Authorization",
14+
"Bearer eyJhbGciOiJIUzI1NiJ9.eyJ1c2VySWQiOjEsImlhdCI6MTc1NDI4MjMzNiwiZXhwIjoxNzU2ODc0MzM2fQ.NG_xDSdh8A6egIX2EAFtsqDO4lmFphTzqgzHC-r8eXY"
15+
)
16+
return chain.proceed(request.build())
17+
}
18+
}

0 commit comments

Comments
 (0)