Skip to content

Commit

Permalink
added netlify config
Browse files Browse the repository at this point in the history
  • Loading branch information
samarth52 committed Aug 12, 2023
1 parent 51a4d6e commit 1e079a5
Show file tree
Hide file tree
Showing 6 changed files with 1,054 additions and 25 deletions.
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -34,4 +34,6 @@ yarn-error.log*

# typescript
*.tsbuildinfo
next-env.d.ts
next-env.d.ts
# Local Netlify folder
.netlify
6 changes: 6 additions & 0 deletions netlify.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
[[plugins]]
package = "@netlify/plugin-nextjs"

[build]
command = "yarn next build"
publish = ".next"
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@
"uuid": "^9.0.0"
},
"devDependencies": {
"@netlify/plugin-nextjs": "^4.39.4",
"eslint": "8.23.1",
"eslint-config-next": "12.3.0",
"eslint-config-prettier": "^8.5.0",
Expand Down
5 changes: 4 additions & 1 deletion src/pages/member.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,16 @@ import urls from "../server/utils/urls";

export async function getServerSideProps(context) {
const session = await getSession(context);

console.log(session);
if (!session) {
return {
redirect: {
destination: urls.pages.login,
permanent: false,
},
props: {
test: "failed",
},
};
}

Expand Down
3 changes: 2 additions & 1 deletion src/screens/Login/LogIn.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,12 @@ import urls from "../../server/utils/urls";
import sendRequest from "../../server/utils/sendToBackend";
import displayMobileView from "../../utils/screen.js";

export default function LoginPage() {
export default function LoginPage({ test }) {
const [email, setEmail] = useState("");
const [password, setPassword] = useState("");
const [failed, setFailed] = useState(null);
const [loading, setLoading] = useState(false);
console.log(test);

useEffect(() => {
if (failed) {
Expand Down
Loading

0 comments on commit 1e079a5

Please sign in to comment.