Advertisement
Guest User

Sammy change context

a guest
Apr 10th, 2018
104
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.86 KB | None | 0 0
  1. this.post('#/register', function (ctx) {
  2.  
  3. let username = ctx.params.username
  4. let password = ctx.params.password
  5. let repeatPass = ctx.params.repeatPass
  6. console.log(username + ":" + repeatPass)
  7. if (username = '' || password == '') {
  8. alert('Username and password can not be empty!')
  9. ctx.redirect('#/index.html')
  10. return
  11. } else {
  12. if (password !== repeatPass) {
  13. alert('Passwords do not match')
  14. ctx.redirect('#/index.html')
  15. return
  16. } else {
  17. console.log(username + ": " + password)
  18. auth.register(ctx.username, password)
  19. ctx.redirect('#/index.html')
  20. }
  21. }
  22. })
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement