-
Notifications
You must be signed in to change notification settings - Fork 42
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Synced navbar with auth state. - Added endpoint to verify a token. - Storing auth token in localStorage and retrieving it. - Attempt to login with existing jwt on app load. - Redirect to home page after login/signup - Added frontend env var for api url.
- Loading branch information
Showing
11 changed files
with
182 additions
and
172 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,15 @@ | ||
import express from 'express'; | ||
import { loginUser, registerUser } from '../controllers/userController'; | ||
import { | ||
loginUser, | ||
registerUser, | ||
verifyUser, | ||
} from '../controllers/userController'; | ||
import { verifyToken } from '../middlewares/authMiddleware'; | ||
|
||
const router = express.Router(); | ||
|
||
router.route('/register').post(registerUser); | ||
router.route('/login').post(loginUser); | ||
router.route('/verify').post(verifyToken, verifyUser); | ||
|
||
export default router; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.