Minor changes
This commit is contained in:
@ -2,13 +2,11 @@
|
|||||||
import { signInWithMicrosoft } from '@/lib/actions';
|
import { signInWithMicrosoft } from '@/lib/actions';
|
||||||
import { StatusMessage, SubmitButton } from '@/components/default';
|
import { StatusMessage, SubmitButton } from '@/components/default';
|
||||||
import { useAuth } from '@/components/context/auth';
|
import { useAuth } from '@/components/context/auth';
|
||||||
import { useRouter } from 'next/navigation';
|
|
||||||
import { useState } from 'react';
|
import { useState } from 'react';
|
||||||
import Image from 'next/image';
|
import Image from 'next/image';
|
||||||
|
|
||||||
export const SignInWithMicrosoft = () => {
|
export const SignInWithMicrosoft = () => {
|
||||||
const router = useRouter();
|
const { isLoading } = useAuth();
|
||||||
const { isLoading, refreshUserData } = useAuth();
|
|
||||||
const [statusMessage, setStatusMessage] = useState('');
|
const [statusMessage, setStatusMessage] = useState('');
|
||||||
const [isSigningIn, setIsSigningIn] = useState(false);
|
const [isSigningIn, setIsSigningIn] = useState(false);
|
||||||
|
|
||||||
@ -30,10 +28,6 @@ export const SignInWithMicrosoft = () => {
|
|||||||
setStatusMessage(
|
setStatusMessage(
|
||||||
`Error: ${error instanceof Error ? error.message : 'Could not sign in!'}`
|
`Error: ${error instanceof Error ? error.message : 'Could not sign in!'}`
|
||||||
);
|
);
|
||||||
} finally {
|
|
||||||
setIsSigningIn(false);
|
|
||||||
await refreshUserData();
|
|
||||||
router.push('');
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
'use client';
|
'use client';
|
||||||
|
|
||||||
import { CardContent, CardHeader, CardTitle } from '@/components/ui';
|
import { CardHeader } from '@/components/ui';
|
||||||
import { SubmitButton } from '@/components/default';
|
import { SubmitButton } from '@/components/default';
|
||||||
import { useRouter } from 'next/navigation';
|
import { useRouter } from 'next/navigation';
|
||||||
import { useAuth } from '@/components/context/auth';
|
import { useAuth } from '@/components/context/auth';
|
||||||
@ -21,6 +21,8 @@ export const SignOut = () => {
|
|||||||
<div className='flex justify-center'>
|
<div className='flex justify-center'>
|
||||||
<CardHeader className='md:w-5/6 w-full'>
|
<CardHeader className='md:w-5/6 w-full'>
|
||||||
<SubmitButton
|
<SubmitButton
|
||||||
|
className='text-[1.0rem] font-semibold cursor-pointer
|
||||||
|
hover:bg-red-700/60 dark:hover:bg-red-300/80'
|
||||||
disabled={isLoading}
|
disabled={isLoading}
|
||||||
onClick={handleSignOut}
|
onClick={handleSignOut}
|
||||||
>
|
>
|
||||||
|
Reference in New Issue
Block a user