-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #5 from brunosllz/change-auth-permission
fix: restrict authentication of users
- Loading branch information
Showing
2 changed files
with
38 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -46,6 +46,15 @@ export const authOptions: NextAuthOptions = { | |
|
||
return session | ||
}, | ||
signIn({ user }) { | ||
const availableEmails = ['[email protected]'] | ||
|
||
if (availableEmails.includes(user.email)) { | ||
return true | ||
} | ||
|
||
return false | ||
}, | ||
}, | ||
session: { | ||
strategy: 'jwt', | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,31 @@ | ||
import { Button } from '@/components/ui/button' | ||
import { Card, CardContent } from '@/components/ui/card' | ||
import { Settings } from 'lucide-react' | ||
import Link from 'next/link' | ||
|
||
export default function SignInError() { | ||
return <h1>Error</h1> | ||
return ( | ||
<div className="wrapper"> | ||
<div className="flex items-center justify-center page-container"> | ||
<Card> | ||
<CardContent className="mt-6 flex flex-col items-center justify-center gap-6"> | ||
<Settings size={24} className="animate-spin" /> | ||
|
||
<div> | ||
<span className="block text-2xl font-semibold"> | ||
A plataforma ainda está em construção | ||
</span> | ||
<span className="block text-center text-muted-foreground"> | ||
O acesso é limite somente a alguns usuário | ||
</span> | ||
</div> | ||
|
||
<Button asChild> | ||
<Link href="/">Voltar para a página inicial</Link> | ||
</Button> | ||
</CardContent> | ||
</Card> | ||
</div> | ||
</div> | ||
) | ||
} |