Come again soon (5)¶
This is the page that people see after a successful logout. It needs only to contain a basic message, or perhaps a link back to the Login page:
Create the required pages¶
Before we add all the Snippets that do all the dirty work, let’s first add the following 5 pages to your MODX Revo site:
Forgot password (2)¶
- Probably hidden from most menus
Login was written by Shaun McCormick as a login/security Extra, and first released on June 25th, 2009. It is now maintained in its fork by the MODX team.
I can’t log in!¶
Usually the errors here revolve around incorrect page IDs, misspellings of Chunk names, or omissions of square brackets in your template tags. Double-check these very carfully.
Also make sure that your Snippets are called uncached! Some of them will function cached, but some will not. They should use the exclamation point in front of them:
I can’t log out!¶
Another subtle error that you might encounter is an inability to log out. One cause of that is pointing your logout link to a page other than your Login page. Remember, your logout link must point to the same page containing the Login snippet!
It’s also possible that your server does not send out the Password Reset emails correctly; in that case you need to debug your email setup on your server.
Login page (1)¶
Put the following Snippet call on your login page:
[[!Login? &loginTpl=`lgnLoginTpl` &logoutTpl=`lgnLogoutTpl` &errTpl=`lgnErrTpl` &loginResourceId=`4` &logoutResourceId=`5` ]]
Then save the page. You’ll notice that the Snippet call has a lot of arguments – many of those arguments reference the names of Chunks. When you installed the Login Add-on, many of these Chunks were already created for you (look under the Elements tab), but sometimes you may want to create your own Chunks and update the Snippet parameters to reference their names. In this example, we are customizing the lgnLoginTpl Chunk.
Optional properties (non login)¶
Helpful parameters which can facilitate Login.
|recaptchaHeight||Can be used to modify the ReCaptcha iframe Height attribute size.||300|
|recaptchaTheme||Can be used to modify the ReCaptcha theme to ‘red’, ‘white’, ‘blackglass’, ‘clean’, or others as they are introduced by Google.||clean|
|recaptchaWidth||Can be used to modify the ReCaptcha iframe Width attribute size.||500|
Now that you’ve put together all these parts, it’s time to test them. If everything works perfectly, then you can login on the Login page and be redirected to the “Members Home Page”. Logging out can be accomplished by visiting the Login page and clicking the “Logout” link (or optionally if you created it, by clicking the “Logout Page” WebLink). Upon successful logout, you should be redirected to the “Come Again Soon” page.
Login comes with some configuration properties you can set to adjust the way Login behaves.
Example for Login:
You can also specify the template, however make sure to call the &tplType parameter also:
[[!Login? &tplType=`modChunk` &loginTpl=`myLoginChunk`]]
See the snippet properties for more options.
What is login?¶
Login is a security Extra for MODX Revolution, that allows for front-end login capabilities, as well as profile updating, registration, and forgot password functionality.
Проблема с двумя формами авторизации
Создание структуры страниц
Для создания функционала авторизации понадобиться создать несколько рабочих страниц. Структуру их расположения в админ панели можно использовать свою, я предпочитаю такой вариант (код по ссылке):