mirror of
				https://github.com/steveiliop56/tinyauth.git
				synced 2025-11-03 23:55:44 +00:00 
			
		
		
		
	refactor: split app context and user context
This commit is contained in:
		@@ -6,9 +6,11 @@ import { useUserContext } from "../context/user-context";
 | 
			
		||||
import { Navigate } from "react-router";
 | 
			
		||||
import { Layout } from "../components/layouts/layout";
 | 
			
		||||
import { capitalize } from "../utils/utils";
 | 
			
		||||
import { useAppContext } from "../context/app-context";
 | 
			
		||||
 | 
			
		||||
export const LogoutPage = () => {
 | 
			
		||||
  const { isLoggedIn, username, oauth, provider, genericName } = useUserContext();
 | 
			
		||||
  const { isLoggedIn, username, oauth, provider } = useUserContext();
 | 
			
		||||
  const { genericName } = useAppContext();
 | 
			
		||||
 | 
			
		||||
  if (!isLoggedIn) {
 | 
			
		||||
    return <Navigate to="/login" />;
 | 
			
		||||
@@ -45,8 +47,9 @@ export const LogoutPage = () => {
 | 
			
		||||
        </Text>
 | 
			
		||||
        <Text>
 | 
			
		||||
          You are currently logged in as <Code>{username}</Code>
 | 
			
		||||
          {oauth && ` using ${capitalize(provider === "generic" ? genericName : provider)} OAuth`}. Click the button
 | 
			
		||||
          below to log out.
 | 
			
		||||
          {oauth &&
 | 
			
		||||
            ` using ${capitalize(provider === "generic" ? genericName : provider)} OAuth`}
 | 
			
		||||
          . Click the button below to log out.
 | 
			
		||||
        </Text>
 | 
			
		||||
        <Button
 | 
			
		||||
          fullWidth
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user