동료가 새 저장소를 만들고 컴퓨터에서 Google JS API를로드해도 아무 문제가 없지만 gapi.client.init
을 실행하면 아래 오류가 반환됩니다. 내가 네트워크의 요청을 볼 때Google 자바 스크립트 API가 클라이언트 초기화시 오류를 반환합니다.
{
"error" : "invalid_request",
"error_description" : "invalid login_hint."
}
, 그것은 쿼리 문자열 매개 변수로 login_hint
의 값에 대한 문자열을 보내지 만, 나는 내 코드베이스 어디서나 해당 문자열이 없습니다.
login_hint:AJDLj6...iriMjPL4JkmR_A
나는 Google API 콘솔의 자격 증명의 새로운 세트를 만들고 내가가 기대하는대로 작동 새로운 클라이언트 ID를 사용하는 경우. 그러나 기존 자격 증명 집합을 사용하면 다른 것을 변경하지 않고 오류가 발생합니다.
export class GoogleApiService {
CLIENT_ID: string = '<removed>.apps.googleusercontent.com';
DISCOVERY_DOCS = ['<removed>'];
SCOPES = '<removed>';
constructor() {
window['initGapi'] = (ev) => {
this.handleClientLoad();
};
this.loadScript();
}
loadScript() {
let script = document.createElement('script');
script.src = 'https://apis.google.com/js/api.js?onload=initGapi';
script.type = 'text/javascript';
document.getElementsByTagName('head')[0].appendChild(script);
}
handleClientLoad() {
gapi.load('client:auth2', this.initClient.bind(this));
}
initClient() {
gapi.client.init({
discoveryDocs: this.DISCOVERY_DOCS,
clientId: this.CLIENT_ID,
scope: this.SCOPES
}).then(() => {
console.log('loaded');
},
(err) => console.error(err));
}
}
내가 login_hint를 지정하지 않는, 그래서 왜 구글에 요청에서 전송되는 :
내 코드는 다음과 같습니다? 오류가 발생하는 이유는 무엇입니까?