Download Amazon-Clone-PERN-stack/src/components/custom_hooks/activeUser.js from Devendra174/react-code-dataset: direct link, hf CLI and curl.
- Browser
- Download file 279 Bytes
-
https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/f5071caa249115f3b590492f1c8eb471e02aae4b/Amazon-Clone-PERN-stack/src/components/custom_hooks/activeUser.js
- Command line
-
hf download hf://datasets/Devendra174/react-code-dataset@f5071caa249115f3b590492f1c8eb471e02aae4b/Amazon-Clone-PERN-stack/src/components/custom_hooks/activeUser.js
-
curl -L -o activeUser.js https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/f5071caa249115f3b590492f1c8eb471e02aae4b/Amazon-Clone-PERN-stack/src/components/custom_hooks/activeUser.js
279 Bytes
| import jwtDecode from "jwt-decode"; | |
| import token from "./GetJwtToken"; | |
| const activeUser = async () => { | |
| try { | |
| console.log("i am randing !!"); | |
| const jwt = token(); | |
| const user = jwtDecode(jwt); | |
| return user; | |
| } catch (e) { | |
| return null; | |
| } | |
| }; | |
| export default activeUser; | |