# Help with creating a login page using a dashboard

**URL:** <https://discourse.nodered.org/t/help-with-creating-a-login-page-using-a-dashboard/87924>\
**Category:** Dashboard\
**Tags:** node-red-dashboard, function-node\
**Created:** [13 May 2024 23:41 UTC](https://discourse.nodered.org/t/help-with-creating-a-login-page-using-a-dashboard/87924 "2024-05-13T23:41:36Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Erissin\_Industria4.0](https://avatars.discourse-cdn.com/v4/letter/e/3ab097/32.png) [@Erissin\_Industria4.0](https://discourse.nodered.org/u/Erissin_Industria4.0)\
**Post date:** [13 May 2024 23:41 UTC](https://discourse.nodered.org/t/help-with-creating-a-login-page-using-a-dashboard/87924/1 "2024-05-13T23:41:36Z")

</div>

Hello everyone, I have a problem with the login page that I created, I can log in if I enter the correct usernames and passwords, however if I press the LOGIN button several times it triggers a pop up that I created, I wanted It only gives this error when I type in the wrong username and password and press the button, but I've already tried and it won't budge.

My flow:

```auto
[{"id":"9f5f09ab900ec697","type":"tab","label":"Modulo B Jacareí","disabled":false,"info":"","env":[]},{"id":"d4412161d3e1ebb5","type":"ui_text_input","z":"9f5f09ab900ec697","name":"","label":"usuário","tooltip":"Digite seu usuário","group":"8cfc2cb973109b78","order":0,"width":0,"height":0,"passthru":false,"mode":"text","delay":"","topic":"topic","sendOnBlur":false,"className":"","topicType":"msg","x":160,"y":200,"wires":[["6bd13efb926fd6b4"]]},{"id":"731f8ae3d04d9a07","type":"ui_text_input","z":"9f5f09ab900ec697","name":"","label":"senha","tooltip":"Digite sua senha","group":"8cfc2cb973109b78","order":0,"width":0,"height":0,"passthru":false,"mode":"password","delay":"","topic":"topic","sendOnBlur":false,"className":"","topicType":"msg","x":150,"y":300,"wires":[["ce3322e7b071ebca"]]},{"id":"6bd13efb926fd6b4","type":"function","z":"9f5f09ab900ec697","name":"function 63","func":"msg.payload1 = msg.payload\nreturn msg;","outputs":1,"timeout":0,"noerr":0,"initialize":"","finalize":"","libs":[],"x":310,"y":200,"wires":[["f23f1ff7dbe17d1e"]]},{"id":"ce3322e7b071ebca","type":"function","z":"9f5f09ab900ec697","name":"function 64","func":"msg.payload2 = msg.payload\nreturn msg;","outputs":1,"timeout":0,"noerr":0,"initialize":"","finalize":"","libs":[],"x":310,"y":300,"wires":[["f23f1ff7dbe17d1e"]]},{"id":"1688abe5626d4525","type":"ui_toast","z":"9f5f09ab900ec697","position":"dialog","displayTime":"3","highlight":"","sendall":true,"outputs":1,"ok":"OK","cancel":"","raw":false,"className":"","topic":"","name":"","x":1330,"y":640,"wires":[[]]},{"id":"16be97b63dbed94d","type":"ui_button","z":"9f5f09ab900ec697","name":"","group":"8cfc2cb973109b78","order":2,"width":0,"height":0,"passthru":false,"label":"LOGIN","tooltip":"","color":"","bgcolor":"","className":"","icon":"","payload":"true","payloadType":"bool","topic":"topic","topicType":"msg","x":160,"y":440,"wires":[["b91fdc5637a02829"]]},{"id":"cdd08ad01716dbe1","type":"ui_led","z":"9f5f09ab900ec697","order":0,"group":"945617d0a2c011bb","width":0,"height":0,"label":"","labelPlacement":"left","labelAlignment":"left","colorForValue":[{"color":"#928b8b","value":"false","valueType":"bool"},{"color":"#008000","value":"true","valueType":"bool"}],"allowColorForValueInMessage":false,"shape":"circle","showGlow":true,"name":"","x":190,"y":580,"wires":[]},{"id":"98b91da54a2fb387","type":"ui_button","z":"9f5f09ab900ec697","name":"","group":"8cfc2cb973109b78","order":2,"width":0,"height":0,"passthru":false,"label":"CANCELAR","tooltip":"","color":"","bgcolor":"","className":"","icon":"","payload":"","payloadType":"num","topic":"topic","topicType":"msg","x":110,"y":240,"wires":[["d4412161d3e1ebb5","731f8ae3d04d9a07"]]},{"id":"e737e9dd69f22042","type":"ui_led","z":"9f5f09ab900ec697","order":0,"group":"0acbfe8e41909f8d","width":0,"height":0,"label":"","labelPlacement":"left","labelAlignment":"left","colorForValue":[{"color":"#928b8b","value":"false","valueType":"bool"},{"color":"#008000","value":"true","valueType":"bool"}],"allowColorForValueInMessage":false,"shape":"circle","showGlow":true,"name":"","x":190,"y":620,"wires":[]},{"id":"b91fdc5637a02829","type":"function","z":"9f5f09ab900ec697","name":"function 69","func":"msg.payload3 = msg.payload\nreturn msg;","outputs":1,"timeout":0,"noerr":0,"initialize":"","finalize":"","libs":[],"x":390,"y":440,"wires":[["0a0a14d0f4505822"]]},{"id":"7af2371ff5218fba","type":"ui_ui_control","z":"9f5f09ab900ec697","name":"","events":"all","x":1360,"y":300,"wires":[[]]},{"id":"fb1ac053bec5caf9","type":"switch","z":"9f5f09ab900ec697","name":"","property":"payload","propertyType":"msg","rules":[{"t":"eq","v":"us","vt":"str"},{"t":"eq","v":"lf","vt":"str"},{"t":"eq","v":"vl","vt":"str"}],"checkall":"false","repair":false,"outputs":3,"x":610,"y":260,"wires":[["a3f523c88a609bdd"],["a3f523c88a609bdd"],["a3f523c88a609bdd"]]},{"id":"f23f1ff7dbe17d1e","type":"join","z":"9f5f09ab900ec697","name":"","mode":"custom","build":"array","property":"payload","propertyType":"msg","key":"topic","joiner":"\\n","joinerType":"str","accumulate":false,"timeout":"","count":"2","reduceRight":false,"reduceExp":"","reduceInit":"","reduceInitType":"","reduceFixup":"","x":330,"y":260,"wires":[["04def968bb097f32"]]},{"id":"04def968bb097f32","type":"function","z":"9f5f09ab900ec697","name":"function 70","func":"if(msg.payload1 == \"manutencao\" && msg.payload2 == \"cfp101\"){\n msg.payload = \"us\"\n}else if (msg.payload1 == \"visitante\" && msg.payload2 == \"senai123\"){\n msg.payload= \"vl\"\n}else{msg.payload = \"lf\"}\nreturn msg;","outputs":1,"timeout":0,"noerr":0,"initialize":"","finalize":"","libs":[],"x":470,"y":260,"wires":[["fb1ac053bec5caf9"]]},{"id":"88cbedb3111b7c44","type":"join","z":"9f5f09ab900ec697","name":"","mode":"custom","build":"array","property":"payload","propertyType":"msg","key":"topic","joiner":"\\n","joinerType":"str","accumulate":false,"timeout":"","count":"2","reduceRight":false,"reduceExp":"","reduceInit":"","reduceInitType":"","reduceFixup":"","x":910,"y":300,"wires":[["77467234f0521602"]]},{"id":"77467234f0521602","type":"function","z":"9f5f09ab900ec697","name":"function 71","func":"if(msg.payload4 == \"us\" && msg.payload3 == true){\n msg.payload = \"Logado\"\n}else if (msg.payload4 == \"vl\" && msg.payload3 == true){\n msg.payload = \"Visit\"}\nelse {msg.payload = \"Falha\"}\nreturn msg;","outputs":1,"timeout":0,"noerr":0,"initialize":"","finalize":"","libs":[],"x":1170,"y":340,"wires":[["7af2371ff5218fba","1f4d476e029a20b2"]]},{"id":"a3f523c88a609bdd","type":"function","z":"9f5f09ab900ec697","name":"function 72","func":"msg.payload4 = msg.payload\nreturn msg;","outputs":1,"timeout":0,"noerr":0,"initialize":"","finalize":"","libs":[],"x":630,"y":140,"wires":[["88cbedb3111b7c44"]]},{"id":"8d5ea64d1c1f7e0c","type":"change","z":"9f5f09ab900ec697","name":"","rules":[{"t":"change","p":"payload","pt":"msg","from":"Falha","fromt":"str","to":"Senha ou usuários incorretos","tot":"str"},{"t":"set","p":"topic","pt":"msg","to":"Falha no login","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":1280,"y":560,"wires":[["1688abe5626d4525"]]},{"id":"1f4d476e029a20b2","type":"switch","z":"9f5f09ab900ec697","name":"","property":"payload","propertyType":"msg","rules":[{"t":"eq","v":"Falha","vt":"str"}],"checkall":"true","repair":false,"outputs":1,"x":1210,"y":460,"wires":[["8d5ea64d1c1f7e0c"]]},{"id":"0a0a14d0f4505822","type":"switch","z":"9f5f09ab900ec697","name":"","property":"payload","propertyType":"msg","rules":[{"t":"true"}],"checkall":"false","repair":false,"outputs":1,"x":610,"y":440,"wires":[["88cbedb3111b7c44"]]},{"id":"8cfc2cb973109b78","type":"ui_group","name":"LOGIN","tab":"71af5b55d0c4ef4a","order":1,"disp":true,"width":"6","collapse":false,"className":""},{"id":"945617d0a2c011bb","type":"ui_group","name":"Logado","tab":"e4434785930e8db8","order":1,"disp":true,"width":"6","collapse":false,"className":""},{"id":"0acbfe8e41909f8d","type":"ui_group","name":"Visit","tab":"2b7e6f98fd2fedf0","order":1,"disp":true,"width":"6","collapse":false,"className":""},{"id":"71af5b55d0c4ef4a","type":"ui_tab","name":"LOGIN","icon":"dashboard","disabled":false,"hidden":true},{"id":"e4434785930e8db8","type":"ui_tab","name":"Logado","icon":"dashboard","disabled":false,"hidden":true},{"id":"2b7e6f98fd2fedf0","type":"ui_tab","name":"Visit","icon":"dashboard","disabled":false,"hidden":true}]

```

Detail: The username and password value only goes if you press enter or tab

usuario "manutencao"  
senha "cfp101"

---

<div class="post-metadata">

**Author:** ![smanjunath211](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/smanjunath211/32/95742_2.png) [@smanjunath211](https://discourse.nodered.org/u/smanjunath211)\
**Post date:** [14 May 2024 05:09 UTC](https://discourse.nodered.org/t/help-with-creating-a-login-page-using-a-dashboard/87924/2 "2024-05-14T05:09:53Z")

</div>

> [@Simple Password Authentication for Dashboard (Caution: Very Low Security, for simple application only)](https://discourse.nodered.org/t/simple-password-authentication-for-dashboard-caution-very-low-security-for-simple-application-only/57714):
>
> an attempt to create a password authentication subflow. Inspired by several posts in this forum. feedback and suggestions required to improve. gives output msg.auth as boolean true or boolean false also shows the result in notification on browser PS: password is password [image] [image] [image] [image] [{"id":"215bd10b8e5bb52e","type":"subflow","name":"Password","info":"","category":"","in":[{"x":110,"y":210,"wires":[{"id":"99cc850a1d0922be"}]}],"out":[{"x":910,"y":190,"wires…

---

<div class="post-metadata">

**Author:** ![Erissin\_Industria4.0](https://avatars.discourse-cdn.com/v4/letter/e/3ab097/32.png) [@Erissin\_Industria4.0](https://discourse.nodered.org/u/Erissin_Industria4.0)\
**Post date:** [14 May 2024 17:50 UTC](https://discourse.nodered.org/t/help-with-creating-a-login-page-using-a-dashboard/87924/3 "2024-05-14T17:50:36Z")

</div>

Thanks for the answer, but in this application I can't use other nodes, just the node patterns and the dashboard UI

---

<div class="post-metadata">

**Author:** ![smanjunath211](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/smanjunath211/32/95742_2.png) [@smanjunath211](https://discourse.nodered.org/u/smanjunath211)\
**Post date:** [15 May 2024 07:45 UTC](https://discourse.nodered.org/t/help-with-creating-a-login-page-using-a-dashboard/87924/4 "2024-05-15T07:45:15Z")

</div>

> [@Erissin\_Industria4.0](#):
>
> it triggers a pop

because the join node just waits for any 2 messages to come. Make the join node a key/value Object , it should solve your issue. I have not checked the flow myself, as there is some issue with your flow.

```auto
[{"id":"9f5f09ab900ec697","type":"tab","label":"Modulo B Jacareí","disabled":false,"info":"","env":[]},{"id":"d4412161d3e1ebb5","type":"ui_text_input","z":"9f5f09ab900ec697","name":"","label":"usuário","tooltip":"Digite seu usuário","group":"8cfc2cb973109b78","order":0,"width":0,"height":0,"passthru":false,"mode":"text","delay":"","topic":"topic","sendOnBlur":false,"className":"","topicType":"msg","x":160,"y":200,"wires":[["6bd13efb926fd6b4"]]},{"id":"731f8ae3d04d9a07","type":"ui_text_input","z":"9f5f09ab900ec697","name":"","label":"senha","tooltip":"Digite sua senha","group":"8cfc2cb973109b78","order":0,"width":0,"height":0,"passthru":false,"mode":"password","delay":"","topic":"topic","sendOnBlur":false,"className":"","topicType":"msg","x":150,"y":300,"wires":[["ce3322e7b071ebca"]]},{"id":"6bd13efb926fd6b4","type":"function","z":"9f5f09ab900ec697","name":"function 63","func":"msg.payload1 = msg.payload\nreturn msg;","outputs":1,"timeout":0,"noerr":0,"initialize":"","finalize":"","libs":[],"x":310,"y":200,"wires":[["f23f1ff7dbe17d1e"]]},{"id":"ce3322e7b071ebca","type":"function","z":"9f5f09ab900ec697","name":"function 64","func":"msg.payload2 = msg.payload\nreturn msg;","outputs":1,"timeout":0,"noerr":0,"initialize":"","finalize":"","libs":[],"x":310,"y":300,"wires":[["f23f1ff7dbe17d1e"]]},{"id":"1688abe5626d4525","type":"ui_toast","z":"9f5f09ab900ec697","position":"dialog","displayTime":"3","highlight":"","sendall":true,"outputs":1,"ok":"OK","cancel":"","raw":false,"className":"","topic":"","name":"","x":1330,"y":640,"wires":[[]]},{"id":"16be97b63dbed94d","type":"ui_button","z":"9f5f09ab900ec697","name":"","group":"8cfc2cb973109b78","order":2,"width":0,"height":0,"passthru":false,"label":"LOGIN","tooltip":"","color":"","bgcolor":"","className":"","icon":"","payload":"true","payloadType":"bool","topic":"topic","topicType":"msg","x":160,"y":440,"wires":[["b91fdc5637a02829"]]},{"id":"cdd08ad01716dbe1","type":"ui_led","z":"9f5f09ab900ec697","order":0,"group":"945617d0a2c011bb","width":0,"height":0,"label":"","labelPlacement":"left","labelAlignment":"left","colorForValue":[{"color":"#928b8b","value":"false","valueType":"bool"},{"color":"#008000","value":"true","valueType":"bool"}],"allowColorForValueInMessage":false,"shape":"circle","showGlow":true,"name":"","x":190,"y":580,"wires":[]},{"id":"98b91da54a2fb387","type":"ui_button","z":"9f5f09ab900ec697","name":"","group":"8cfc2cb973109b78","order":2,"width":0,"height":0,"passthru":false,"label":"CANCELAR","tooltip":"","color":"","bgcolor":"","className":"","icon":"","payload":"","payloadType":"num","topic":"topic","topicType":"msg","x":110,"y":240,"wires":[["d4412161d3e1ebb5","731f8ae3d04d9a07"]]},{"id":"e737e9dd69f22042","type":"ui_led","z":"9f5f09ab900ec697","order":0,"group":"0acbfe8e41909f8d","width":0,"height":0,"label":"","labelPlacement":"left","labelAlignment":"left","colorForValue":[{"color":"#928b8b","value":"false","valueType":"bool"},{"color":"#008000","value":"true","valueType":"bool"}],"allowColorForValueInMessage":false,"shape":"circle","showGlow":true,"name":"","x":190,"y":620,"wires":[]},{"id":"b91fdc5637a02829","type":"function","z":"9f5f09ab900ec697","name":"function 69","func":"msg.payload3 = msg.payload\nreturn msg;","outputs":1,"timeout":0,"noerr":0,"initialize":"","finalize":"","libs":[],"x":390,"y":440,"wires":[["0a0a14d0f4505822"]]},{"id":"7af2371ff5218fba","type":"ui_ui_control","z":"9f5f09ab900ec697","name":"","events":"all","x":1360,"y":300,"wires":[[]]},{"id":"fb1ac053bec5caf9","type":"switch","z":"9f5f09ab900ec697","name":"","property":"payload","propertyType":"msg","rules":[{"t":"eq","v":"us","vt":"str"},{"t":"eq","v":"lf","vt":"str"},{"t":"eq","v":"vl","vt":"str"}],"checkall":"false","repair":false,"outputs":3,"x":610,"y":260,"wires":[["a3f523c88a609bdd"],["a3f523c88a609bdd"],["a3f523c88a609bdd"]]},{"id":"f23f1ff7dbe17d1e","type":"join","z":"9f5f09ab900ec697","name":"","mode":"custom","build":"array","property":"payload","propertyType":"msg","key":"topic","joiner":"\\n","joinerType":"str","accumulate":false,"timeout":"","count":"2","reduceRight":false,"reduceExp":"","reduceInit":"","reduceInitType":"","reduceFixup":"","x":330,"y":260,"wires":[["04def968bb097f32"]]},{"id":"04def968bb097f32","type":"function","z":"9f5f09ab900ec697","name":"function 70","func":"if(msg.payload1 == \"manutencao\" && msg.payload2 == \"cfp101\"){\n msg.payload = \"us\"\n}else if (msg.payload1 == \"visitante\" && msg.payload2 == \"senai123\"){\n msg.payload= \"vl\"\n}else{msg.payload = \"lf\"}\nreturn msg;","outputs":1,"timeout":0,"noerr":0,"initialize":"","finalize":"","libs":[],"x":470,"y":260,"wires":[["fb1ac053bec5caf9"]]},{"id":"88cbedb3111b7c44","type":"join","z":"9f5f09ab900ec697","name":"","mode":"custom","build":"object","property":"payload","propertyType":"msg","key":"topic","joiner":"\\n","joinerType":"str","accumulate":false,"timeout":"","count":"2","reduceRight":false,"reduceExp":"","reduceInit":"","reduceInitType":"","reduceFixup":"","x":980,"y":300,"wires":[["77467234f0521602"]]},{"id":"77467234f0521602","type":"function","z":"9f5f09ab900ec697","name":"function 71","func":"if(msg.payload4 == \"us\" && msg.payload3 == true){\n msg.payload = \"Logado\"\n}else if (msg.payload4 == \"vl\" && msg.payload3 == true){\n msg.payload = \"Visit\"}\nelse {msg.payload = \"Falha\"}\nreturn msg;","outputs":1,"timeout":0,"noerr":0,"initialize":"","finalize":"","libs":[],"x":1170,"y":340,"wires":[["7af2371ff5218fba","1f4d476e029a20b2"]]},{"id":"a3f523c88a609bdd","type":"function","z":"9f5f09ab900ec697","name":"function 72","func":"msg.payload4 = msg.payload\nreturn msg;","outputs":1,"timeout":0,"noerr":0,"initialize":"","finalize":"","libs":[],"x":630,"y":140,"wires":[["7235d2295b298584"]]},{"id":"8d5ea64d1c1f7e0c","type":"change","z":"9f5f09ab900ec697","name":"","rules":[{"t":"change","p":"payload","pt":"msg","from":"Falha","fromt":"str","to":"Senha ou usuários incorretos","tot":"str"},{"t":"set","p":"topic","pt":"msg","to":"Falha no login","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":1280,"y":560,"wires":[["1688abe5626d4525"]]},{"id":"1f4d476e029a20b2","type":"switch","z":"9f5f09ab900ec697","name":"","property":"payload","propertyType":"msg","rules":[{"t":"eq","v":"Falha","vt":"str"}],"checkall":"true","repair":false,"outputs":1,"x":1210,"y":460,"wires":[["8d5ea64d1c1f7e0c"]]},{"id":"0a0a14d0f4505822","type":"switch","z":"9f5f09ab900ec697","name":"","property":"payload","propertyType":"msg","rules":[{"t":"true"}],"checkall":"false","repair":false,"outputs":1,"x":610,"y":440,"wires":[["552ed35850868172"]]},{"id":"552ed35850868172","type":"change","z":"9f5f09ab900ec697","name":"","rules":[{"t":"set","p":"topic","pt":"msg","to":"two","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":810,"y":330,"wires":[["88cbedb3111b7c44"]]},{"id":"7235d2295b298584","type":"change","z":"9f5f09ab900ec697","name":"","rules":[{"t":"set","p":"topic","pt":"msg","to":"one","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":810,"y":270,"wires":[["88cbedb3111b7c44"]]},{"id":"8cfc2cb973109b78","type":"ui_group","name":"LOGIN","tab":"71af5b55d0c4ef4a","order":1,"disp":true,"width":"6","collapse":false,"className":""},{"id":"945617d0a2c011bb","type":"ui_group","name":"Logado","tab":"e4434785930e8db8","order":1,"disp":true,"width":"6","collapse":false,"className":""},{"id":"0acbfe8e41909f8d","type":"ui_group","name":"Visit","tab":"2b7e6f98fd2fedf0","order":1,"disp":true,"width":"6","collapse":false,"className":""},{"id":"71af5b55d0c4ef4a","type":"ui_tab","name":"LOGIN","icon":"dashboard","disabled":false,"hidden":true},{"id":"e4434785930e8db8","type":"ui_tab","name":"Logado","icon":"dashboard","disabled":false,"hidden":true},{"id":"2b7e6f98fd2fedf0","type":"ui_tab","name":"Visit","icon":"dashboard","disabled":false,"hidden":true}]

```

---

<div class="post-metadata">

**Author:** ![smanjunath211](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/smanjunath211/32/95742_2.png) [@smanjunath211](https://discourse.nodered.org/u/smanjunath211)\
**Post date:** [15 May 2024 07:46 UTC](https://discourse.nodered.org/t/help-with-creating-a-login-page-using-a-dashboard/87924/5 "2024-05-15T07:46:44Z")

</div>

sorry, i could not follow what you meant here.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/1X/d073cd938eafa2e558d7c2cd59003b3ef4963033.png) [@system](https://discourse.nodered.org/u/system)\
**Post date:** [29 May 2024 07:47 UTC](https://discourse.nodered.org/t/help-with-creating-a-login-page-using-a-dashboard/87924/6 "2024-05-29T07:47:32Z")

</div>

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.
