Kubessandra / react-google-calendar-api

An api to manage your google calendar

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Authentication Callback

carlmagumpara opened this issue · comments

Please add call back for authentication.

Ex:
ApiCalendar.handleAuthClick()
.then((result) => {
console.log(result);
}).catch((error) => {
console.log(error);
});

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,
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?

Yeah, sure, just create a Pull Request, and assign me in Review when its done.

Thanks

And replace the return function: void by any or by the real type

@carlmagumpara Any updates?