인증 코드 저장 부분 익명화.
This commit is contained in:
@@ -32,11 +32,11 @@ export async function exchangeAuthorizationCode(code: string, state: string) {
|
||||
tokenType?: string;
|
||||
expiresIn?: string | number;
|
||||
};
|
||||
message?: string;
|
||||
code?: number;
|
||||
};
|
||||
if (!res.ok || !json.content?.accessToken) {
|
||||
throw new Error(json.message || `토큰 발급 실패 (${res.status})`);
|
||||
// 외부 API 원문은 계정 정보 등이 섞일 수 있으므로 전달·기록하지 않는다.
|
||||
throw new Error(`치지직 인증 처리 실패 (${res.status})`);
|
||||
}
|
||||
return {
|
||||
accessToken: json.content.accessToken,
|
||||
@@ -54,10 +54,9 @@ export async function fetchAuthedUser(accessToken: string) {
|
||||
});
|
||||
const json = (await res.json().catch(() => ({}))) as {
|
||||
content?: { channelId?: string; channelName?: string };
|
||||
message?: string;
|
||||
};
|
||||
if (!res.ok || !json.content?.channelId) {
|
||||
throw new Error(json.message || `유저 정보 조회 실패 (${res.status})`);
|
||||
throw new Error(`치지직 사용자 확인 실패 (${res.status})`);
|
||||
}
|
||||
return {
|
||||
channelId: json.content.channelId.toLowerCase(),
|
||||
|
||||
Reference in New Issue
Block a user