migrate auth db to sql server

This commit is contained in:
2022-08-23 15:06:55 +01:00
parent 4b38849f1d
commit 69a81e482f
13 changed files with 194 additions and 91 deletions
+16 -14
View File
@@ -18,6 +18,7 @@ import { reduxForm, formValueSelector } from "redux-form";
import RegisterForm from "../../components/account/registerform";
import { dehashString, hashAPIPath } from "../../actions";
import { getSession, useSession, signIn, signOut } from "next-auth/react";
const Home = (props) => {
const { footerLinks, formData, loggedInUserEmail } = props;
@@ -156,22 +157,23 @@ const Home = (props) => {
};
export const getServerSideProps = wrapper.getServerSideProps(
(store) =>
async ({ query, req, res }) => {
let hasRegistrationEmail = typeof query.id != "undefined";
let loginEmailStr = "";
(store) => async (ctx) => {
const { query, req, res } = ctx;
if (hasRegistrationEmail == true) {
loginEmailStr = dehashString(query.id);
let thisSession = await getSession(ctx);
console.log(loginEmailStr);
}
return {
props: {
loggedInUserEmail: loginEmailStr,
},
};
}
console.log(
"auth sess for register :",
thisSession,
thisSession.user.email
);
return {
props: {
loggedInUserEmail: thisSession.user.email,
},
};
}
);
const mapStateToProps = (state) => {