Skip to content

Commit

Permalink
auto redirect to sso login on sso signup
Browse files Browse the repository at this point in the history
  • Loading branch information
sadnub committed Oct 19, 2024
1 parent c8b6ad1 commit fe3604f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
3 changes: 3 additions & 0 deletions src/ee/sso/api/sso.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import axios from "axios";
import { getCookie } from "@/ee/sso/utils/cookies";
import { getBaseUrl } from "@/boot/axios";
import { useStorage } from "@vueuse/core";

import type { SSOProvider, SSOSettings } from "@/ee/sso/types/sso";

Expand Down Expand Up @@ -129,6 +130,8 @@ export async function disconnectSSOAccount(
}

export async function openSSOProviderRedirect(id: string) {
//save provider to local storage
useStorage("provider_id", id);
postForm(`${getBaseUrl()}/${allauthBase}/auth/provider/redirect`, {
provider: id,
process: "login",
Expand Down
4 changes: 1 addition & 3 deletions src/ee/sso/views/ProviderCallback.vue
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,10 @@ import { useRoute, useRouter } from "vue-router";
import { useAuthStore } from "@/stores/auth";
const route = useRoute();
const error = route.params.error;
const error = route.query.error;
const router = useRouter();
const auth = useAuthStore();
if (!error) {
if (auth.loggedIn) {
router.push({ name: "Dashboard" });
Expand Down

0 comments on commit fe3604f

Please sign in to comment.