mirror of
https://github.com/aykhans/slash-e.git
synced 2025-04-20 14:01:24 +00:00
fix: auth callback
This commit is contained in:
parent
db09ac2c5c
commit
d4e575774c
@ -1,4 +1,3 @@
|
|||||||
import { last } from "lodash-es";
|
|
||||||
import { ClientError } from "nice-grpc-web";
|
import { ClientError } from "nice-grpc-web";
|
||||||
import { useEffect, useState } from "react";
|
import { useEffect, useState } from "react";
|
||||||
import { useSearchParams } from "react-router-dom";
|
import { useSearchParams } from "react-router-dom";
|
||||||
@ -34,7 +33,7 @@ const AuthCallback = () => {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
const idpId = last(state.split("-"));
|
const idpId = state;
|
||||||
if (!idpId) {
|
if (!idpId) {
|
||||||
setState({
|
setState({
|
||||||
loading: false,
|
loading: false,
|
||||||
|
@ -62,7 +62,7 @@ const SignIn: React.FC = () => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
const handleSignInWithIdentityProvider = async (identityProvider: IdentityProvider) => {
|
const handleSignInWithIdentityProvider = async (identityProvider: IdentityProvider) => {
|
||||||
const stateQueryParameter = `auth.signin.${identityProvider.title}-${identityProvider.id}`;
|
const stateQueryParameter = identityProvider.id;
|
||||||
if (identityProvider.type === IdentityProvider_Type.OAUTH2) {
|
if (identityProvider.type === IdentityProvider_Type.OAUTH2) {
|
||||||
const redirectUri = absolutifyLink("/auth/callback");
|
const redirectUri = absolutifyLink("/auth/callback");
|
||||||
const oauth2Config = identityProvider.config?.oauth2;
|
const oauth2Config = identityProvider.config?.oauth2;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user