From 7c186f3a501cbeb5f929a8e9184df7502bfd0741 Mon Sep 17 00:00:00 2001 From: Sofya Kholodkova <38243298+tomato-frog@users.noreply.github.com> Date: Thu, 13 Feb 2020 11:02:03 +0300 Subject: [PATCH] Update russian localization (#37258) --- .../registration-of-new-users.russian.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/curriculum/challenges/russian/06-information-security-and-quality-assurance/advanced-node-and-express/registration-of-new-users.russian.md b/curriculum/challenges/russian/06-information-security-and-quality-assurance/advanced-node-and-express/registration-of-new-users.russian.md index c58438707a9..fa0f91999d9 100644 --- a/curriculum/challenges/russian/06-information-security-and-quality-assurance/advanced-node-and-express/registration-of-new-users.russian.md +++ b/curriculum/challenges/russian/06-information-security-and-quality-assurance/advanced-node-and-express/registration-of-new-users.russian.md @@ -8,10 +8,10 @@ localeTitle: Регистрация новых пользователей ## Description
-As a reminder, this project is being built upon the following starter project on Glitch, or cloned from GitHub. -Now we need to allow a new user on our site to register an account. On the res.render for the home page add a new variable to the object passed along- showRegistration: true. When you refresh your page, you should then see the registration form that was already created in your index.pug file! This form is set up to POST on /register so this is where we should set up to accept the POST and create the user object in the database. -The logic of the registration route should be as follows: Register the new user > Authenticate the new user > Redirect to /profile -The logic of step 1, registering the new user, should be as follows: Query database with a findOne command > if user is returned then it exists and redirect back to home OR if user is undefined and no error occurs then 'insertOne' into the database with the username and password and as long as no errors occur then call next to go to step 2, authenticating the new user, which we've already written the logic for in our POST /login route. +Напомним, что этот проект строится на следующем стартовом проекте на Glitch, или клонированном из GitHub. +Теперь нам нужно разрешить новому пользователю на нашем сайте зарегистрировать учетную запись. На res.render для домашней страницы добавьте новую переменную к переданному объекту- showRegistration: true. При обновлении страницы вы должны увидеть регистрационную форму, которая уже была создана в файле index.pug ! Эта форма настроена на POST на /register поэтому здесь мы должны настроить прием POST и создать объект пользователя в базе данных. +Логика регистрационного маршрута должна выглядеть следующим образом: Регистрация нового пользователя > аутентификация нового пользователя > перенаправление в /profile +Логика шага 1, регистрация нового пользователя, должна быть следующей: Запрос базы данных с помощью команды findOne > если пользователь возвращается, то он существует и перенаправляется обратно на home или если пользователь не определен и не возникает ошибок, то 'insertOne' в базу данных с именем пользователя и паролем и до тех пор, пока не возникнет ошибок, затем вызовите next чтобы перейти к Шагу 2, аутентифицируя нового пользователя, для которого мы уже написали логику в нашем POST /login маршруте. ```js app.route('/register')