nss-evening-cohort-10 / nutshell-nautilus-explorer

0 stars 0 forks source link

Auth-LogOut #28

Closed aleshakay closed 4 years ago

aleshakay commented 5 years ago

User Story

AC WHEN I am already logged in to the dashboard, I would see a navbar to the right - top of the page. THEN I logout to the webpage I should be able to click a button what is label logout AND the application should logout the user and the button label should say LogIn AND after logout is clicked in the landing page of the dashboard with cards and table should be visible.

Dev Notes

const authDiv = $('#auth'); const logoutButton = $('#navbar-button-logout');

const logoutEvent = () => { logoutButton.click((e) => { e.preventDefault(); firebase.auth().signOut() .then(() => { authDiv.classList.add('hide'); logoutButton.classList.add('hide'); }).catch((err) => console.error('you still logged in', err)); }); };

export default { logoutEvent };```

aleshakay commented 4 years ago
Screen Shot 2019-11-14 at 22 22 27