ayush_uidev
ayush_uidev
TTCTheo's Typesafe Cult
Created by ayush_uidev on 7/8/2023 in #questions
Zod type email string and number message not working correctly
4 replies
TTCTheo's Typesafe Cult
Created by ayush_uidev on 7/6/2023 in #questions
Redirect next-auth signIn to history page
thanks @peterkyle01
18 replies
TTCTheo's Typesafe Cult
Created by ayush_uidev on 7/6/2023 in #questions
Redirect next-auth signIn to history page
18 replies
TTCTheo's Typesafe Cult
Created by ayush_uidev on 7/6/2023 in #questions
Redirect next-auth signIn to history page
thanks @peterkyle01
18 replies
TTCTheo's Typesafe Cult
Created by ayush_uidev on 7/6/2023 in #questions
Redirect next-auth signIn to history page
this was my mistake next-auth does not add callback searchParams when it is redirected from the "/" url it only add searchParams when it is redirected from the different page for example "/about" then i updated the code something like this
const searchParams = useSearchParams();
const callbackUrl = searchParams.get("callbackUrl");

function onSubmit(data: Inputs) {
startTransition(async () => {
try {
await signIn("credentials", {
redirect: true,
email: data.email,
password: data.password,
callbackUrl: callbackUrl || "/",
});
} catch (error) {
console.log(error);
toast.error("Something Went Wrong");
}
});
}
const searchParams = useSearchParams();
const callbackUrl = searchParams.get("callbackUrl");

function onSubmit(data: Inputs) {
startTransition(async () => {
try {
await signIn("credentials", {
redirect: true,
email: data.email,
password: data.password,
callbackUrl: callbackUrl || "/",
});
} catch (error) {
console.log(error);
toast.error("Something Went Wrong");
}
});
}
now it works
18 replies
TTCTheo's Typesafe Cult
Created by ayush_uidev on 7/6/2023 in #questions
Redirect next-auth signIn to history page
actually no worries i have figured it out thanks for help
18 replies
TTCTheo's Typesafe Cult
Created by ayush_uidev on 7/6/2023 in #questions
Redirect next-auth signIn to history page
but this is giving me current url i want the url before i was redirected to signIn page as i was unAuthenticated
18 replies
TTCTheo's Typesafe Cult
Created by ayush_uidev on 7/6/2023 in #questions
Redirect next-auth signIn to history page
router.pathname does not exist in nextjs 13 app dir
18 replies
TTCTheo's Typesafe Cult
Created by ayush_uidev on 7/6/2023 in #questions
Redirect next-auth signIn to history page
I want the behaviour like the next-auth custom signIn pages have callback searchparams which redirects to the page which was open before the redirect to signIn page ?
18 replies
TTCTheo's Typesafe Cult
Created by ayush_uidev on 7/6/2023 in #questions
Redirect next-auth signIn to history page
or can you tell me where to put it
18 replies
TTCTheo's Typesafe Cult
Created by ayush_uidev on 7/6/2023 in #questions
Redirect next-auth signIn to history page
@peterkyle01 how is that possible ? you got any example
18 replies
TTCTheo's Typesafe Cult
Created by ayush_uidev on 7/6/2023 in #questions
Redirect next-auth signIn to history page
for time being my code looks something like this
function onSubmit(data: Inputs) {
startTransition(async () => {
try {
await signIn("credentials", {
redirect: true,
email: data.email,
password: data.password,
callbackUrl: "/",
});
} catch (error) {
console.log(error);
toast.error("Something Went Wrong");
}
});
}
function onSubmit(data: Inputs) {
startTransition(async () => {
try {
await signIn("credentials", {
redirect: true,
email: data.email,
password: data.password,
callbackUrl: "/",
});
} catch (error) {
console.log(error);
toast.error("Something Went Wrong");
}
});
}
18 replies
TTCTheo's Typesafe Cult
Created by ayush_uidev on 6/19/2023 in #questions
Passing and Accessing Authentication Tokens from External Backend to Client-side Components in Next.
did not work that well but i will try figuring out this problem some other time thanks i am marking it as done
9 replies
TTCTheo's Typesafe Cult
Created by ayush_uidev on 6/19/2023 in #questions
Passing and Accessing Authentication Tokens from External Backend to Client-side Components in Next.
i will try this
9 replies