auto redirect to sso login on sso signup
This commit is contained in:
@@ -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",
|
||||||
|
@@ -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" });
|
||||||
|
Reference in New Issue
Block a user