mirror of
https://github.com/steveiliop56/tinyauth.git
synced 2025-12-14 12:16:35 +00:00
feat: add support for auto redirecting to oauth providers
This commit is contained in:
@@ -1,9 +1,9 @@
|
||||
import { Button, Code, Paper, Text } from "@mantine/core";
|
||||
import { Layout } from "../components/layouts/layout";
|
||||
import { Navigate } from "react-router";
|
||||
import { isQueryValid } from "../utils/utils";
|
||||
import { Trans, useTranslation } from "react-i18next";
|
||||
import React from "react";
|
||||
import { isValidQuery } from "../utils/utils";
|
||||
|
||||
export const UnauthorizedPage = () => {
|
||||
const queryString = window.location.search;
|
||||
@@ -14,11 +14,11 @@ export const UnauthorizedPage = () => {
|
||||
|
||||
const { t } = useTranslation();
|
||||
|
||||
if (!isQueryValid(username)) {
|
||||
if (!isValidQuery(username)) {
|
||||
return <Navigate to="/" />;
|
||||
}
|
||||
|
||||
if (isQueryValid(resource) && !isQueryValid(groupErr)) {
|
||||
if (isValidQuery(resource) && !isValidQuery(groupErr)) {
|
||||
return (
|
||||
<UnauthorizedLayout>
|
||||
<Trans
|
||||
@@ -31,7 +31,7 @@ export const UnauthorizedPage = () => {
|
||||
);
|
||||
}
|
||||
|
||||
if (isQueryValid(groupErr) && isQueryValid(resource)) {
|
||||
if (isValidQuery(groupErr) && isValidQuery(resource)) {
|
||||
return (
|
||||
<UnauthorizedLayout>
|
||||
<Trans
|
||||
|
||||
Reference in New Issue
Block a user