|
@@ -5,8 +5,9 @@ import { useMainStore } from "@/stores/main";
|
|
|
import { useDisplay } from "vuetify";
|
|
|
import { storeToRefs } from "pinia";
|
|
|
import { useI18n } from "vue-i18n";
|
|
|
-import Navbar from "@/components/Navbar.vue";
|
|
|
import { googleTokenLogin } from "vue3-google-login";
|
|
|
+import { saveLocalToken } from "@/utils";
|
|
|
+import Navbar from "@/components/Navbar.vue";
|
|
|
|
|
|
const GOOGLE_CLIENT_ID =
|
|
|
"136107811725-n71808u8t465f1afhpe2e5j7mn606nd8.apps.googleusercontent.com";
|
|
@@ -16,19 +17,18 @@ const data = ref();
|
|
|
const handleGoogleAccessTokenLogin = () => {
|
|
|
googleTokenLogin({
|
|
|
clientId: GOOGLE_CLIENT_ID,
|
|
|
- }).then((response) => {
|
|
|
+ }).then((response: any) => {
|
|
|
console.log("Google response", response);
|
|
|
+ console.log("response.access_token", response.access_token);
|
|
|
data.value = response;
|
|
|
+ saveLocalToken(response.access_token);
|
|
|
+ mainStore.setToken(response.access_token);
|
|
|
});
|
|
|
};
|
|
|
|
|
|
const mainStore = useMainStore();
|
|
|
const mainStoreRef = storeToRefs(mainStore);
|
|
|
|
|
|
-const callback = (response: any) => {
|
|
|
- console.log("Google response", response);
|
|
|
-};
|
|
|
-
|
|
|
// variable
|
|
|
const email = ref("");
|
|
|
const password = ref("");
|