diff --git a/README.md b/README.md index 60ac499..68e4c7a 100644 --- a/README.md +++ b/README.md @@ -56,6 +56,10 @@ ## 업데이트 로그 +### 2022.9.13 v2.3.17 +- 상태 페이지 개선. +- 재학 상태 확인시 인증 정보는 헤더에 평문으로. + ### 2022.9.9 v2.3.16 - 학생 인증 기능 복귀. - 백엔드 의존성 업데이트. diff --git a/config.ts b/config.ts index 6dc90a4..17b6593 100644 --- a/config.ts +++ b/config.ts @@ -143,7 +143,6 @@ export default { inuApi: { accountStatusUrl: `https://api.inuappcenter.kr/account/status`, - key: getSecret('LOGIN_KEY', '앱센터는 모다?'), }, uicoop: { diff --git a/lib/external/inu/StudentAccountValidator.ts b/lib/external/inu/StudentAccountValidator.ts index 1716028..e9ee55b 100644 --- a/lib/external/inu/StudentAccountValidator.ts +++ b/lib/external/inu/StudentAccountValidator.ts @@ -21,7 +21,6 @@ import fetch from 'isomorphic-fetch'; import config from '../../../config'; import assert from 'assert'; import {logger} from '@inu-cafeteria/backend-core'; -import {encrypt} from '../../common/utils/cipher'; import {withTimeout} from '../../common/utils/timeout'; import { BadFormedCredentials, @@ -34,17 +33,16 @@ export default class StudentAccountValidator { constructor(private readonly studentId: string, private readonly password: string) {} async shouldBeUndergraduateWithCorrectCredentials(): Promise { - if (this.studentId === '202099999' && this.password === 'xptmxmzzzz') { + if (this.studentId === '202099999' && this.password === 'xptmxmzzzz' /*테스틐ㅋㅋㅋ*/) { logger.info('테스트 계정입니다!'); return; } - const studentId = this.studentId; - const password = this.encryptPassword(); - const url = config.external.inuApi.accountStatusUrl; const headers = { - authorization: `Basic ${Buffer.from(`${studentId}:${password}`).toString('base64')}`, + authorization: `Basic ${Buffer.from(`${this.studentId}:${this.password}`).toString( + 'base64' + )}`, }; const response = await this.getResponse(url, headers); @@ -76,8 +74,4 @@ export default class StudentAccountValidator { throw StudentLoginUnavailable(); } } - - private encryptPassword() { - return encrypt(this.password, config.external.inuApi.key); - } }