👌 IMPROVE: Changements URL /profile en /users
This commit is contained in:
		| @@ -148,7 +148,7 @@ exports.confirmEmail = async (req, res, next) => { | ||||
|         user.tempToken = null; | ||||
|         user.isConfirmed = true; | ||||
|         await user.save(); | ||||
|         return res.redirect(`${FRONT_END_HOST}/login?isConfirmed=true`); | ||||
|         return res.redirect(`${FRONT_END_HOST}/users/login?isConfirmed=true`); | ||||
|     } catch (error) { | ||||
|         console.log(error); | ||||
|         return errorHandling(next, serverError); | ||||
| @@ -174,7 +174,7 @@ exports.resetPassword = async (req, res, next) => { | ||||
|             from: `"FunctionProject" <${EMAIL_INFO.auth.user}>`, | ||||
|             to: email, | ||||
|             subject: "FunctionProject - Réinitialisation du mot de passe", | ||||
|             html: emailUserTemplate("Veuillez confirmer la réinitialisation du mot de passe", "Oui, je change mon mot de passe.", `${FRONT_END_HOST}/newPassword?token=${tempToken}`, "Si vous avez reçu ce message par erreur, il suffit de le supprimer. Votre mot de passe ne sera pas réinitialiser si vous ne cliquez pas sur le lien ci-dessus. Par ailleurs, pour la sécurité de votre compte, la réinitialisation du mot de passe est disponible pendant un délai de 1 heure, passez ce temps, la réinitialisation ne sera plus valide.") | ||||
|             html: emailUserTemplate("Veuillez confirmer la réinitialisation du mot de passe", "Oui, je change mon mot de passe.", `${FRONT_END_HOST}/users/newPassword?token=${tempToken}`, "Si vous avez reçu ce message par erreur, il suffit de le supprimer. Votre mot de passe ne sera pas réinitialiser si vous ne cliquez pas sur le lien ci-dessus. Par ailleurs, pour la sécurité de votre compte, la réinitialisation du mot de passe est disponible pendant un délai de 1 heure, passez ce temps, la réinitialisation ne sera plus valide.") | ||||
|         }); | ||||
|         return res.status(200).json({ result: "Demande de réinitialisation du mot de passe réussi, veuillez vérifier vos emails!" }); | ||||
|     } catch (error) { | ||||
|   | ||||
| @@ -28,11 +28,11 @@ const CommentCard = forwardRef((props, ref) => { | ||||
|         <div ref={ref} className="CommentCard col-24"> | ||||
|             <div className="CommentCard__container"> | ||||
|                 <div className="row"> | ||||
|                     <Link href={"/profile/[name]"} as={`/profile/${props.user.name}`}> | ||||
|                     <Link href={"/users/[name]"} as={`/users/${props.user.name}`}> | ||||
|                         <img className="CommentCard__user-logo" src={API_URL + props.user.logo} alt={props.user.name} />     | ||||
|                     </Link> | ||||
|                     <span className="CommentCard__message-info"> | ||||
|                         <Link href={"/profile/[name]"} as={`/profile/${props.user.name}`}> | ||||
|                         <Link href={"/users/[name]"} as={`/users/${props.user.name}`}> | ||||
|                             <a>{props.user.name}</a> | ||||
|                         </Link>  | ||||
|                          - {date.format(new Date(props.createdAt), 'DD/MM/YYYY à HH:mm', true)} | ||||
|   | ||||
| @@ -40,14 +40,14 @@ export default function Header() { | ||||
|                         { | ||||
|                             (!isAuth) ?  | ||||
|                                 <Fragment> | ||||
|                                     <NavigationLink name="S'inscrire" path="/register" /> | ||||
|                                     <NavigationLink name="Connexion" path="/login" /> | ||||
|                                     <NavigationLink name="S'inscrire" path="/users/register" /> | ||||
|                                     <NavigationLink name="Connexion" path="/users/login" /> | ||||
|                                 </Fragment> | ||||
|                             : | ||||
|                                 <Fragment> | ||||
|                                     <li className="navbar-item"> | ||||
|                                         <Link href={"/profile/[name]"} as={`/profile/${user.name}`}> | ||||
|                                             <a className={`navbar-link ${pathname === "/profile/[name]" ? "navbar-link-active" : null}`}>Mon Profil</a> | ||||
|                                         <Link href={"/users/[name]"} as={`/users/${user.name}`}> | ||||
|                                             <a className={`navbar-link ${pathname === "/users/[name]" ? "navbar-link-active" : null}`}>Mon Profil</a> | ||||
|                                         </Link> | ||||
|                                     </li> | ||||
|                                     <li className="navbar-item"> | ||||
|   | ||||
| @@ -85,7 +85,7 @@ const manageQuotes = (props) => { | ||||
|                                                 <td className="table-row text-center">{currentQuote.quote}</td> | ||||
|                                                 <td className="table-row text-center">{currentQuote.author}</td> | ||||
|                                                 <td className="table-row text-center"> | ||||
|                                                     <Link href={"/profile/[name]"} as={`/profile/${currentQuote.user.name}`}> | ||||
|                                                     <Link href={"/users/[name]"} as={`/users/${currentQuote.user.name}`}> | ||||
|                                                         <a>{currentQuote.user.name}</a> | ||||
|                                                     </Link> | ||||
|                                                 </td> | ||||
|   | ||||
| @@ -130,7 +130,7 @@ const QuoteList = () => { | ||||
|                                             <td className="table-row text-center">{currentQuote.quote}</td> | ||||
|                                             <td className="table-row text-center">{currentQuote.author}</td> | ||||
|                                             <td className="table-row text-center"> | ||||
|                                                 <Link href={"/profile/[name]"} as={`/profile/${currentQuote.user.name}`}> | ||||
|                                                 <Link href={"/users/[name]"} as={`/users/${currentQuote.user.name}`}> | ||||
|                                                     <a>{currentQuote.user.name}</a> | ||||
|                                                 </Link> | ||||
|                                             </td> | ||||
|   | ||||
| @@ -1,10 +1,10 @@ | ||||
| import { Fragment, useState } from 'react'; | ||||
| import htmlParser from 'html-react-parser'; | ||||
| import Loader from '../components/Loader'; | ||||
| import HeadTag from '../components/HeadTag'; | ||||
| import api from '../utils/api'; | ||||
| import withoutAuth from '../hoc/withoutAuth'; | ||||
| import '../public/css/pages/register-login.css'; | ||||
| import Loader from '../../components/Loader'; | ||||
| import HeadTag from '../../components/HeadTag'; | ||||
| import api from '../../utils/api'; | ||||
| import withoutAuth from '../../hoc/withoutAuth'; | ||||
| import '../../public/css/pages/register-login.css'; | ||||
| 
 | ||||
| const forgotPassword = () => { | ||||
| 
 | ||||
| @@ -2,11 +2,11 @@ import { Fragment, useContext, useState } from 'react'; | ||||
| import { useRouter } from 'next/router'; | ||||
| import Link from 'next/link'; | ||||
| import htmlParser from 'html-react-parser'; | ||||
| import Loader from '../components/Loader'; | ||||
| import HeadTag from '../components/HeadTag'; | ||||
| import { UserContext } from '../contexts/UserContext'; | ||||
| import withoutAuth from '../hoc/withoutAuth'; | ||||
| import '../public/css/pages/register-login.css'; | ||||
| import Loader from '../../components/Loader'; | ||||
| import HeadTag from '../../components/HeadTag'; | ||||
| import { UserContext } from '../../contexts/UserContext'; | ||||
| import withoutAuth from '../../hoc/withoutAuth'; | ||||
| import '../../public/css/pages/register-login.css'; | ||||
| 
 | ||||
| const Login = () => { | ||||
| 
 | ||||
| @@ -1,11 +1,11 @@ | ||||
| import { Fragment, useState } from 'react'; | ||||
| import htmlParser from 'html-react-parser'; | ||||
| import Loader from '../components/Loader'; | ||||
| import HeadTag from '../components/HeadTag'; | ||||
| import api from '../utils/api'; | ||||
| import redirect from '../utils/redirect'; | ||||
| import withoutAuth from '../hoc/withoutAuth'; | ||||
| import '../public/css/pages/register-login.css'; | ||||
| import Loader from '../../components/Loader'; | ||||
| import HeadTag from '../../components/HeadTag'; | ||||
| import api from '../../utils/api'; | ||||
| import redirect from '../../utils/redirect'; | ||||
| import withoutAuth from '../../hoc/withoutAuth'; | ||||
| import '../../public/css/pages/register-login.css'; | ||||
| 
 | ||||
| const newPassword = (props) => { | ||||
| 
 | ||||
| @@ -1,10 +1,10 @@ | ||||
| import { Fragment, useState } from 'react'; | ||||
| import htmlParser from 'html-react-parser'; | ||||
| import Loader from '../components/Loader'; | ||||
| import HeadTag from '../components/HeadTag'; | ||||
| import api from '../utils/api'; | ||||
| import withoutAuth from '../hoc/withoutAuth'; | ||||
| import '../public/css/pages/register-login.css'; | ||||
| import Loader from '../../components/Loader'; | ||||
| import HeadTag from '../../components/HeadTag'; | ||||
| import api from '../../utils/api'; | ||||
| import withoutAuth from '../../hoc/withoutAuth'; | ||||
| import '../../public/css/pages/register-login.css'; | ||||
| 
 | ||||
| const Register = () => { | ||||
|      | ||||
		Reference in New Issue
	
	Block a user