]> git.openstreetmap.org Git - rails.git/commitdiff
Check that the token is valid before using it.
authorTom Hughes <tom@compton.nu>
Tue, 20 Apr 2010 10:05:55 +0000 (11:05 +0100)
committerTom Hughes <tom@compton.nu>
Tue, 20 Apr 2010 10:05:55 +0000 (11:05 +0100)
app/views/site/edit.html.erb

index 3565b046816d41658434471f34efdedfd113d7e9..779abd352b659324992a20c4efd53fc924180066 100644 (file)
@@ -20,7 +20,7 @@
 <%= render :partial => 'search' %>
 
 <%
 <%= render :partial => 'search' %>
 
 <%
-session[:token] = @user.tokens.create.token unless session[:token]
+session[:token] = @user.tokens.create.token unless session[:token] and UserToken.find_by_token(session[:token])
 
 # Decide on a lat lon to initialise potlatch with. Various ways of doing this
 if params['lon'] and params['lat']
 
 # Decide on a lat lon to initialise potlatch with. Various ways of doing this
 if params['lon'] and params['lat']