nwplus / portal

portal for hackers at nwplus hackathons
https://portal.nwplus.io/
12 stars 1 forks source link

Logout on dashboard #118

Closed panjenny0 closed 3 years ago

panjenny0 commented 3 years ago
kevin-zou commented 3 years ago

@panjenny0 By "functionality included" does that mean it should log the user out of their session? If so, is this blocked by the auth tasks?

panjenny0 commented 3 years ago

@kevin-zou Good question! Yea it means logging the user out of their current session. I think this is technically blocked by both the auth task and the routing. I will have a PR for routing done either today or tomorrow so maybe to get started, you could just do the router part and once the auth is done, you can add the sign out on firebase :) How it was done in the CMS was something like

          await firebase.auth().signOut();
          router.push('/');

in https://github.com/nwplus/CMS-V2/blob/master/pages/index.js

the above router is from useRouter in next/router(from next.js), but since we're not using next.js, maybe you can look into https://reactrouter.com/web/api/Hooks (somethng like useHistory) EDIT wait I just realized we use wouter lmao docs here https://github.com/molefrog/wouter

panjenny0 commented 3 years ago

closed by #184

ianmah commented 3 years ago

184?

panjenny0 commented 3 years ago

184?

I saw the logout button had been added, maybe this wasn't added in #184 but it worked in that PR

ianmah commented 3 years ago

oh haha Allison did it with Dan in a different PR

panjenny0 commented 3 years ago

oh haha Allison did it with Dan in a different PR

Oh HAHA okay nice whoops my bad 😬 good job Dan!!

acchiang commented 3 years ago

no our bad for forgetting to attach the pr here! ty

acchiang commented 3 years ago

HEADS UP, logging out redirects back to dashboard because there are dashboard features a logged out user can use