Skip to content

Commit

Permalink
Merge pull request #23 from git-init-priyanshu/nextjs
Browse files Browse the repository at this point in the history
Fixed redirect issue
  • Loading branch information
git-init-priyanshu authored Sep 5, 2024
2 parents 1317ab9 + a709e63 commit dde19db
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion app/(auth)/signin/components/SignInForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ export default function CredentialsForm() {
const response = await SigninAction(parsedData);
if (response.success) {
toast.success("login completed");
router.push("/");
router.push("/document");
setIsSubmitting(false);
} else {
toast.error(response.error);
Expand Down
2 changes: 1 addition & 1 deletion app/(auth)/signup/components/SignUpForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ export default function CredentialsForm() {
const response = await SignupAction(parsedData);
if (response.success) {
toast.success("Signin completed");
router.push("/");
router.push("/document");
setIsSubmitting(false);
} else {
console.log(response.error);
Expand Down
2 changes: 1 addition & 1 deletion lib/auth.ts
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ export const authOptions: NextAuthOptions = {
return session;
},
redirect({ baseUrl }) {
return baseUrl;
return `${baseUrl}/document`;
},
},
cookies: {
Expand Down

0 comments on commit dde19db

Please sign in to comment.