oauth
parent
117f1889a6
commit
03bcd07341
|
@ -1,7 +1,7 @@
|
||||||
import { Button } from "antd";
|
import { Button } from "antd";
|
||||||
import { useTranslation } from "react-i18next";
|
import { useTranslation } from "react-i18next";
|
||||||
import { Constants } from "../../../utils";
|
import { Constants } from "../../../utils";
|
||||||
import * as hello from "hellojs";
|
import hello from "hellojs";
|
||||||
import { useEffect } from "react";
|
import { useEffect } from "react";
|
||||||
|
|
||||||
export default function StoreCalendar() {
|
export default function StoreCalendar() {
|
||||||
|
@ -32,10 +32,20 @@ export default function StoreCalendar() {
|
||||||
<Button
|
<Button
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
hello("google")
|
hello("google")
|
||||||
.login()
|
.login(
|
||||||
|
{
|
||||||
|
scope: "https://www.googleapis.com/auth/calendar",
|
||||||
|
},
|
||||||
|
(e) => {
|
||||||
|
console.log("login error", e);
|
||||||
|
}
|
||||||
|
)
|
||||||
.then(
|
.then(
|
||||||
() => {
|
() => {
|
||||||
console.log("login success");
|
console.log("Login successful");
|
||||||
|
var accessToken =
|
||||||
|
hello("google").getAuthResponse().access_token;
|
||||||
|
console.log("Access token: " + accessToken);
|
||||||
},
|
},
|
||||||
(e) => {
|
(e) => {
|
||||||
console.log("login error", e);
|
console.log("login error", e);
|
||||||
|
|
Loading…
Reference in New Issue