mirror of
https://github.com/danny-avila/LibreChat.git
synced 2025-12-17 00:40:14 +01:00
🔒feat: Enable OpenID Auto-Redirect (#6066)
* added feature for oidc auto redirection * Added Cooldown logic for OIDC auto redirect for failed login attempts * 🔧 feat: Implement custom logout redirect handling and enhance OpenID auto-redirect logic * 🔧 refactor: Update getLoginError to use TranslationKeys for improved type safety * 🔧 feat: Localize redirect message to OpenID provider in Login component --------- Co-authored-by: Ruben Talstra <RubenTalstra1211@outlook.com>
This commit is contained in:
parent
09abce063f
commit
f95d5aaf4d
11 changed files with 102 additions and 17 deletions
|
|
@ -1,5 +1,5 @@
|
|||
import React, { useState, useEffect } from 'react';
|
||||
import { Outlet, useNavigate } from 'react-router-dom';
|
||||
import { Outlet } from 'react-router-dom';
|
||||
import type { ContextType } from '~/common';
|
||||
import {
|
||||
AgentsMapContext,
|
||||
|
|
@ -15,7 +15,6 @@ import { Nav, MobileNav } from '~/components/Nav';
|
|||
import { Banner } from '~/components/Banners';
|
||||
|
||||
export default function Root() {
|
||||
const navigate = useNavigate();
|
||||
const [showTerms, setShowTerms] = useState(false);
|
||||
const [bannerHeight, setBannerHeight] = useState(0);
|
||||
const [navVisible, setNavVisible] = useState(() => {
|
||||
|
|
@ -44,10 +43,10 @@ export default function Root() {
|
|||
setShowTerms(false);
|
||||
};
|
||||
|
||||
// Pass the desired redirect parameter to logout
|
||||
const handleDeclineTerms = () => {
|
||||
setShowTerms(false);
|
||||
logout();
|
||||
navigate('/login');
|
||||
logout('/login?redirect=false');
|
||||
};
|
||||
|
||||
if (!isAuthenticated) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue