From a361639183a7c9989f40410576c44dbd1d1bc658 Mon Sep 17 00:00:00 2001 From: Matt Kirby <MattJKirby@outlook.com> Date: Thu, 13 Apr 2023 23:20:08 +0100 Subject: [PATCH] store username and user token in session storage --- daily-thought-frontend/src/pages/signIn.tsx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/daily-thought-frontend/src/pages/signIn.tsx b/daily-thought-frontend/src/pages/signIn.tsx index e3aa4975..da00b299 100644 --- a/daily-thought-frontend/src/pages/signIn.tsx +++ b/daily-thought-frontend/src/pages/signIn.tsx @@ -24,11 +24,11 @@ const SignIn = () => { const response = await fetch(endpoint, options) const result = await response.json() - console.log(result.error) - if(result.error !== undefined){ setError(result.error) - } else { + } else { + sessionStorage.setItem('username', result.username) + sessionStorage.setItem('token', result.token) Router.push("/feed") } } -- GitLab