This file contains hidden or 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
| module.exports = { | |
| secret: "cacan-secret-key" | |
| }; |
This file contains hidden or 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
| module.exports = { | |
| HOST: "localhost", | |
| USER: "root", | |
| PASSWORD: "j.fUjHyL", | |
| DB: "nodejs_auth_jwt", | |
| dialect: "mysql", | |
| pool: { | |
| max: 5, | |
| min: 0, | |
| acquire: 30000, |
This file contains hidden or 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
| label { | |
| display: block; | |
| margin-top: 10px; | |
| } | |
| .card-container.card { | |
| max-width: 350px !important; | |
| padding: 40px 40px; | |
| } |
This file contains hidden or 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
| import React, { useEffect } from "react"; | |
| import { useDispatch, useSelector } from "react-redux"; | |
| import { Router, Switch, Route, Link } from "react-router-dom"; | |
| import "bootstrap/dist/css/bootstrap.min.css"; | |
| import logo from './logo.svg'; | |
| import "./App.css"; | |
| import Login from "./components/Login"; | |
| import Register from "./components/Register"; |
This file contains hidden or 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
| import { createBrowserHistory } from "history"; | |
| export const history = createBrowserHistory(); |
This file contains hidden or 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
| import React, { useState, useEffect } from "react"; | |
| import UserService from "../services/user.service"; | |
| const Home = () => { | |
| const [content, setContent] = useState(""); | |
| useEffect(() => { | |
| UserService.getPublicContent().then( | |
| (response) => { |
This file contains hidden or 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
| import React from "react"; | |
| import { Redirect } from 'react-router-dom'; | |
| import { useSelector } from "react-redux"; | |
| const Profile = () => { | |
| const { user: currentUser } = useSelector((state) => state.auth); | |
| if (!currentUser) { | |
| return <Redirect to="/login" />; | |
| } |
This file contains hidden or 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
| import React, { useState, useRef } from "react"; | |
| import { useDispatch, useSelector } from "react-redux"; | |
| import { Redirect } from 'react-router-dom'; | |
| import Form from "react-validation/build/form"; | |
| import Input from "react-validation/build/input"; | |
| import CheckButton from "react-validation/build/button"; | |
| import { login } from "../actions/auth"; |
This file contains hidden or 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
| import React, { useState, useRef } from "react"; | |
| import { useDispatch, useSelector } from "react-redux"; | |
| import Form from "react-validation/build/form"; | |
| import Input from "react-validation/build/input"; | |
| import CheckButton from "react-validation/build/button"; | |
| import { isEmail } from "validator"; | |
| import { register } from "../actions/auth"; |
This file contains hidden or 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
| import { createStore, applyMiddleware } from "redux"; | |
| import { composeWithDevTools } from "redux-devtools-extension"; | |
| import thunk from "redux-thunk"; | |
| import rootReducer from "./reducers"; | |
| const middleware = [thunk]; | |
| const store = createStore( | |
| rootReducer, | |
| composeWithDevTools(applyMiddleware(...middleware)) |