Skip to content
Snippets Groups Projects
Commit a3616391 authored by Matt Kirby's avatar Matt Kirby
Browse files

store username and user token in session storage

parent 4794e464
No related branches found
No related tags found
No related merge requests found
...@@ -24,11 +24,11 @@ const SignIn = () => { ...@@ -24,11 +24,11 @@ const SignIn = () => {
const response = await fetch(endpoint, options) const response = await fetch(endpoint, options)
const result = await response.json() const result = await response.json()
console.log(result.error)
if(result.error !== undefined){ if(result.error !== undefined){
setError(result.error) setError(result.error)
} else { } else {
sessionStorage.setItem('username', result.username)
sessionStorage.setItem('token', result.token)
Router.push("/feed") Router.push("/feed")
} }
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment