Advertisement
djuggler

InvalidAuthenticityToken

Sep 11th, 2019
200
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.85 KB | None | 0 0
  1. *******************************************
  2. * Problem
  3. *******************************************
  4. Wheels.InvalidAuthenticityToken
  5.  
  6. This POSTed request was attempted without a valid authenticity token.
  7. Tag context
  8.  
  9. Error thrown on line 34 in wheels\controller\csrf.cfm
  10. - called from line 11 in wheels\controller\processing.cfm
  11. - called from line 184 in wheels\dispatch\functions.cfm
  12. - called from line 5 in wheels\index.cfm
  13. - called from line 2 in index.cfm
  14. - called from line 5 in wheels\events\onrequest.cfm
  15.  
  16. *******************************************
  17. * login.cfm generated code from view source code
  18. *******************************************
  19. <html>
  20. <head>
  21. </head>
  22. <body>
  23. <form action="/index.cfm/alfred/signin" method="post"><input id="authenticityToken" name="authenticityToken" type="hidden" value="F45F79BBE31DAEA0FBEB75268DD62512BE2F3306"><input id="_method" name="_method" type="hidden" value="post"> <label for="logintoken">Login token<input id="logintoken" name="logintoken" type="text" value=""></label> <input type="submit" value="Login"> </form>
  24. </body>
  25. </html>
  26.  
  27. *******************************************
  28. * routes
  29. *******************************************
  30. <cfscript>
  31.  
  32. mapper()
  33. .root(to="referees##login", method="get,post")
  34. .post(name="alfredsignin", pattern="alfred/signin", to="alfred##signin", method="post")
  35. .end();
  36.  
  37. </cfscript>
  38.  
  39. *******************************************
  40. * controllers
  41. *******************************************
  42. Alfred.cfc: (note: the cfscript stuff is because I'm refactoring from markup to cfscript)
  43. <cfcomponent extends="Controller" output="false">
  44.  
  45. <cffunction name="config">
  46. <cfscript>
  47. super.config();
  48. freememory(); //initialize memory numbers
  49. </cfscript>
  50. </cffunction>
  51.  
  52. <cffunction name="login">
  53. <cfscript>
  54. param name="params.logintoken" default="";
  55. </cfscript>
  56. </cffunction>
  57.  
  58. <cffunction name="signin">
  59. <cfscript>
  60. param name="params.logintoken" default="";
  61. </cfscript>
  62. </cffunction>
  63.  
  64. </cfcomponent>
  65.  
  66. *******************************************
  67. * Views
  68. *******************************************
  69. layout.cfm
  70.  
  71. <!--- Place HTML here that should be used as the default layout of your application. --->
  72. <html>
  73. <head>
  74. <!--- <cfoutput>#csrfMetaTags()#</cfoutput> --->
  75. </head>
  76.  
  77. <body>
  78. <cfoutput>
  79. #flashMessages()#
  80. #includeContent()#
  81. </cfoutput>
  82. </body>
  83. </html>
  84.  
  85. -----------------------------------------------------------------
  86. login.cfm
  87.  
  88. <cfoutput>
  89. <p>
  90. #flash("error")#
  91. </p>
  92. #startFormTag(route="alfredsignin")#
  93.  
  94. #textFieldTag(label="Login token", name="logintoken", value=params.logintoken)#
  95.  
  96. #submitTag(value="Login")#
  97.  
  98. #endFormTag()#
  99.  
  100. #createLoginToken(54,1654961)#
  101. </cfoutput>
  102. -----------------------------------------------------------------
  103. signin.cfm
  104.  
  105. Arrived
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement