Authentication Callback
carlmagumpara opened this issue · comments
Carl Anthony commented
Please add call back for authentication.
Ex:
ApiCalendar.handleAuthClick()
.then((result) => {
console.log(result);
}).catch((error) => {
console.log(error);
});
Kubessandra commented
Hi,
Yeah its possible, just need to find the time, will try today.
But if you want to make a contribution you can, Just transform:
public handleAuthClick(): void {
if (this.gapi) {
this.gapi.auth2.getAuthInstance().signIn();
} else {
console.log("Error: this.gapi not loaded")
}
}
Into:
public handleAuthClick(): void {
if (this.gapi) {
return this.gapi.auth2.getAuthInstance().signIn();
} else {
console.log("Error: this.gapi not loaded")
return Promise.reject(new Error("Error: this.gapi not loaded"));
}
}
Carl Anthony commented
Hi,
Yeah its possible, just need to find the time, will try today.But if you want to make a contribution you can, Just transform:
public handleAuthClick(): void { if (this.gapi) { this.gapi.auth2.getAuthInstance().signIn(); } else { console.log("Error: this.gapi not loaded") } }Into:
public handleAuthClick(): void { if (this.gapi) { return this.gapi.auth2.getAuthInstance().signIn(); } else { console.log("Error: this.gapi not loaded") return Promise.reject(new Error("Error: this.gapi not loaded")); } }
Hi, can i be a contributor?
Kubessandra commented
Yeah, sure, just create a Pull Request, and assign me in Review when its done.
Thanks
Kubessandra commented
And replace the return function: void
by any
or by the real type
Kubessandra commented
@carlmagumpara Any updates?