freeCodeCamp/curriculum/challenges/spanish/06-information-security-and.../advanced-node-and-express/how-to-put-a-profile-togeth...

2.0 KiB

id title challengeType videoUrl localeTitle
5895f70ef9fc0f352b528e6b How to Put a Profile Together 2 Cómo armar un perfil

Description

Como recordatorio, este proyecto se está construyendo sobre el siguiente proyecto de inicio en Glitch , o clonado desde GitHub . Ahora que podemos asegurarnos de que el usuario que accede al / profile esté autenticado, ¡podemos usar la información contenida en 'req.user' en nuestra página! Continúe y pase el objeto que contiene la variable nombre de usuario que equivale a 'req.user.username' en el método de representación de la vista de perfil. Luego vaya a su vista 'profile.pug' y añada la línea h2.center#welcome Welcome, #{username}! creando el elemento h2 con la clase 'center' e id 'welcome' que contiene el texto 'Welcome' y el nombre de usuario! También en el perfil, agregue un enlace a / logout . Esa ruta alojará la lógica para no autenticar a un usuario. a(href='/logout') Logout Envíe su página cuando crea que la tiene correcta.

Instructions

Tests

tests:
  - text: Agregó correctamente una variable de renderizado Pug a / perfil
    testString: 'getUserInput => $.get(getUserInput("url")+ "/_api/server.js") .then(data => { assert.match(data, /\/views\/pug\/profile[^]*username:( |)req.user.username/gi, "You should be passing the variable username with req.user.username into the render function of the profile page"); }, xhr => { throw new Error(xhr.statusText); })'

Challenge Seed

Solution

// solution required