cleaned up rep functionality

This commit is contained in:
2024-01-24 14:19:36 +00:00
parent a650452d18
commit b7a643a6b1
15 changed files with 57 additions and 235 deletions
+7 -31
View File
@@ -90,40 +90,16 @@ const SignIn = (props) => {
);
};
// export async function getServerSideProps(context) {
// //console.log("-1-1-1-1-", context.query.callbackUrl, context.locale);
// //console.log("------ " + context.query.callbackUrl);
// // setCookie(context, "next-auth.callback-url", context.query.callbackUrl, {
// // path: "/",
// // });
// const csrfToken = await getCsrfToken(context);
// let callback =
// context.locale != "cy"
// ? process.env.NEXTAUTH_URL
// : "https://" + process.env.I18N_DOMAIN + ":3000";
// context.query.callbackUrl = callback;
// let formURL =
// new URL(callback).protocol +
// "//" +
// new URL(callback).hostname +
// ":" +
// new URL(callback).port; // +
// // "/api/auth/signin/email";
// //console.log("******", formURL, callback, csrfToken);
// return {
// props: { csrfToken: csrfToken, callbackUrl: formURL, redirect: true },
// };
// }
export async function getServerSideProps(context) {
const csrfToken = await getCsrfToken(context);
console.log("-1-1-1-1-", context.query.callbackUrl, context.locale);
console.log(
"\n//////////////////////\n",
"Sign in callbackurl: " + context.query.callbackUrl,
context.locale,
"\n//////////////////////\n"
);
let formURL = context.query.callbackUrl;
console.log("formUrl:", formURL);
//console.log("formUrl:", formURL);
formURL = typeof formURL == "undefined" ? null : formURL;
return {