Withdrew the comments.

This commit is contained in:
elweyn 2021-11-10 06:15:58 +01:00
parent 4af3c6ed8c
commit 75d7ff3905

View File

@ -2,9 +2,6 @@
import { AuthChecker } from 'type-graphql'
import CONFIG from '../../config'
import { apiGet } from '../../apis/HttpRequest'
import decode from '../../jwt/decode'
import encode from '../../jwt/encode'
@ -13,15 +10,9 @@ const isAuthorized: AuthChecker<any> = async (
) => {
if (context.token) {
const decoded = decode(context.token)
// if (decoded.sessionId && decoded.sessionId !== 0) {
// const result = await apiGet(
// `${CONFIG.LOGIN_API_URL}checkSessionState?session_id=${decoded.sessionId}`,
// )
// context.sessionId = decoded.sessionId
context.pubKey = decoded.pubKey
context.setHeaders.push({ key: 'token', value: encode(decoded.pubKey) })
return true
// }
}
throw new Error('401 Unauthorized')
}