generated from muhtadeetaron/nextjs-template
fix(nav): improve navigation for authorization routes
This commit is contained in:
@ -29,7 +29,7 @@ const LoginPage = () => {
|
||||
setIsLoading(true);
|
||||
setError(null);
|
||||
await login(form, setToken);
|
||||
router.push("/home");
|
||||
router.replace("/home");
|
||||
} catch (err: unknown) {
|
||||
console.error(err);
|
||||
|
||||
|
||||
@ -88,7 +88,7 @@ export default function RegisterPage() {
|
||||
|
||||
try {
|
||||
await register(form, setToken);
|
||||
router.push("/login");
|
||||
router.replace("/login");
|
||||
} catch (err: unknown) {
|
||||
setError(formatError(err));
|
||||
console.error("User creation error: ", err);
|
||||
|
||||
@ -73,7 +73,10 @@ export default function MockScreen() {
|
||||
<Header displayTabTitle="Mocks" />
|
||||
<div className="overflow-y-auto">
|
||||
<div className="mt-5 px-5">
|
||||
<DestructibleAlert text={errorMsg} />
|
||||
<h1 className="text-2xl font-semibold my-5">
|
||||
{user?.preparation_unit}
|
||||
</h1>
|
||||
<DestructibleAlert text={errorMsg} variant="error" />
|
||||
</div>
|
||||
<div className="flex justify-center mt-4">
|
||||
<button
|
||||
|
||||
@ -68,7 +68,10 @@ export default function PaperScreen() {
|
||||
<Header displayTabTitle="Subjects" />
|
||||
<div className="overflow-y-auto">
|
||||
<div className="mt-5 px-5">
|
||||
<DestructibleAlert text={errorMsg} />
|
||||
<h1 className="text-2xl font-semibold my-5">
|
||||
{user?.preparation_unit}
|
||||
</h1>
|
||||
<DestructibleAlert text={errorMsg} variant="error" />
|
||||
</div>
|
||||
<div className="flex justify-center mt-4">
|
||||
<button
|
||||
|
||||
@ -72,7 +72,10 @@ export default function TopicScreen() {
|
||||
<Header displayTabTitle="Subjects" />
|
||||
<div className="overflow-y-auto">
|
||||
<div className="mt-5 px-5">
|
||||
<DestructibleAlert text={errorMsg} />
|
||||
<h1 className="text-2xl font-semibold my-5">
|
||||
{user?.preparation_unit}
|
||||
</h1>
|
||||
<DestructibleAlert text={errorMsg} variant="error" />
|
||||
</div>
|
||||
<div className="flex justify-center mt-4">
|
||||
<button
|
||||
|
||||
Reference in New Issue
Block a user