auto redirect to sso login on sso signup

This commit is contained in:
sadnub
2024-10-18 20:01:42 -04:00
committed by wh1te909
parent d0cf72bbd2
commit 0e59f580c3
2 changed files with 4 additions and 3 deletions

View File

@@ -1,6 +1,7 @@
import axios from "axios"; import axios from "axios";
import { getCookie } from "@/ee/sso/utils/cookies"; import { getCookie } from "@/ee/sso/utils/cookies";
import { getBaseUrl } from "@/boot/axios"; import { getBaseUrl } from "@/boot/axios";
import { useStorage } from "@vueuse/core";
import type { SSOProvider, SSOSettings } from "@/ee/sso/types/sso"; import type { SSOProvider, SSOSettings } from "@/ee/sso/types/sso";
@@ -129,6 +130,8 @@ export async function disconnectSSOAccount(
} }
export async function openSSOProviderRedirect(id: string) { export async function openSSOProviderRedirect(id: string) {
//save provider to local storage
useStorage("provider_id", id);
postForm(`${getBaseUrl()}/${allauthBase}/auth/provider/redirect`, { postForm(`${getBaseUrl()}/${allauthBase}/auth/provider/redirect`, {
provider: id, provider: id,
process: "login", process: "login",

View File

@@ -18,12 +18,10 @@ import { useRoute, useRouter } from "vue-router";
import { useAuthStore } from "@/stores/auth"; import { useAuthStore } from "@/stores/auth";
const route = useRoute(); const route = useRoute();
const error = route.params.error; const error = route.query.error;
const router = useRouter(); const router = useRouter();
const auth = useAuthStore(); const auth = useAuthStore();
if (!error) { if (!error) {
if (auth.loggedIn) { if (auth.loggedIn) {
router.push({ name: "Dashboard" }); router.push({ name: "Dashboard" });