]> git.openstreetmap.org Git - rails.git/blobdiff - app/views/site/edit.rhtml
Various updates to the user management, including the creation of a
[rails.git] / app / views / site / edit.rhtml
index 08d6133c4aa17ea66c6be1ff09b524b8543c0e46..548a1acaf7b4a96b461389f40a44126ae52d2850 100644 (file)
@@ -5,6 +5,8 @@
 <% else %>
 <%= render :partial => 'search', :locals => { :onopen => "resizeMap();", :onclose => "resizeMap();" } %>
 
+<% session[:token] = @user.tokens.create.token unless session[:token] %>
+
 <% if params['mlon'] and params['mlat'] %>
 <% lon =  params['mlon'] %>
 <% lat =  params['mlat']  %>
@@ -34,7 +36,7 @@
     fo.addVariable('lat',lat);
     fo.addVariable('long',lon);
     fo.addVariable('scale',sc);
-    fo.addVariable('token','<%= @user.token %>');
+    fo.addVariable('token','<%= session[:token] %>');
     fo.write("map");
   }