fix duplicate auth_token in development database images
diff --git a/lib/current_user.rb b/lib/current_user.rb
index d31119b99f..054db9f01d 100644
--- a/lib/current_user.rb
+++ b/lib/current_user.rb
@@ -13,7 +13,7 @@ module CurrentUser
def log_on_user(user)
session[:current_user_id] = user.id
- unless user.auth_token
+ unless user.auth_token && user.auth_token.length == 32
user.auth_token = SecureRandom.hex(16)
user.save!
end
diff --git a/pg_dumps/development-image.sql b/pg_dumps/development-image.sql
index c76acd21ff..3103803ada 100644
--- a/pg_dumps/development-image.sql
+++ b/pg_dumps/development-image.sql
@@ -5766,27 +5766,27 @@ SELECT pg_catalog.setval('user_visits_id_seq', 52, true);
--
COPY users (id, username, created_at, updated_at, name, bio_raw, seen_notification_id, last_posted_at, email, password_hash, salt, active, username_lower, auth_token, last_seen_at, website, admin, last_emailed_at, email_digests, trust_level, bio_cooked, email_private_messages, email_direct, approved, approved_by_id, approved_at, topics_entered, posts_read_count, digest_after_days, previous_visit_at, banned_at, banned_till, date_of_birth, auto_track_topics_after_msecs, views, flag_level, time_read, days_visited, ip_address, new_topic_duration_minutes, external_links_in_new_tab, enable_quoting, moderator) FROM stdin;
-21 OldSchoolDM 2013-02-04 18:10:14.84202 2013-02-04 18:33:20.338235 The Old School DM I was primarily an AD&D 1st edition DM and campaign designer for over 20 years then "retired" for about 10. I'm now getting back into it because my professional illustrator/daughter and I are building a game-world/campaign and we're building it for 4th edition. I've also developed a bit of a thing for paper terrain for my games 47 \N oldschooldm@mailinator.com c510193134d9347b917fde91ecfa63fd8580262ebbe757b911bfd0e3469daf3b 8c53b9af0df959d538fcb99ec20a9679 t oldschooldm 1ca2db2d17c4df25c3002d0515cdbecb 2013-02-04 20:03:24 http://cardboard-warriors.proboards.com/index.cgi?action=userrecentposts&user=oldschooldm f 2013-02-04 18:10:15.547097 t 1 <p>I was primarily an AD&D 1st edition DM and campaign designer for over 20 years then "retired" for about 10. I'm now getting back into it because my professional illustrator/daughter and I are building a game-world/campaign and we're building it for 4th edition. I've also developed a bit of a thing for paper terrain for my games</p> t t f \N \N 2 2 7 \N \N \N \N 60000 0 0 43 1 98.234.248.204 \N f t f
-19 gknauss 2013-02-01 01:28:51.197714 2013-02-04 19:47:08.936018 Greg Knauss HELLO\n===== 47 2013-02-04 19:51:59.86907 gknauss@mailinator.com c510193134d9347b917fde91ecfa63fd8580262ebbe757b911bfd0e3469daf3b 8c53b9af0df959d538fcb99ec20a9679 t gknauss 1ca2db2d17c4df25c3002d0515cdbecb 2013-02-04 19:54:03 http://--- f 2013-02-04 19:46:59.279009 t 1 <h1>HELLO </h1> t t f \N \N 7 20 7 2013-02-01 05:17:58 \N \N \N 60000 0 0 324148 2 67.49.59.30 \N f t f
-22 clay_7 2013-02-04 18:20:33.984339 2013-02-04 19:37:00.322684 Clay \N 47 2013-02-04 19:43:40.45135 clay_7@mailinator.com c510193134d9347b917fde91ecfa63fd8580262ebbe757b911bfd0e3469daf3b 8c53b9af0df959d538fcb99ec20a9679 t clay_7 1ca2db2d17c4df25c3002d0515cdbecb 2013-02-04 19:43:38 \N f 2013-02-04 19:36:52.34913 t 1 \N t t f \N \N 8 21 7 \N \N \N \N \N 0 0 4976 1 174.99.106.174 \N f t f
-4 marcy 2013-01-24 09:49:19.002165 2013-01-25 00:36:56.361142 Marcy \N 47 \N marcy@mailinator.com c510193134d9347b917fde91ecfa63fd8580262ebbe757b911bfd0e3469daf3b 8c53b9af0df959d538fcb99ec20a9679 t marcy 1ca2db2d17c4df25c3002d0515cdbecb 2013-01-25 00:36:56 \N f 2013-02-01 06:00:01.288905 t 2 \N t t f \N \N 0 2 7 2013-01-24 11:03:41 \N \N \N \N 0 0 40 2 \N \N f t f
-3 NickSahler 2013-01-24 08:55:35.16022 2013-01-25 03:03:02.504085 Nick \N 47 \N nicksahler@mailinator.com c510193134d9347b917fde91ecfa63fd8580262ebbe757b911bfd0e3469daf3b 8c53b9af0df959d538fcb99ec20a9679 t nicksahler 1ca2db2d17c4df25c3002d0515cdbecb 2013-01-25 03:03:02 \N f 2013-02-01 06:00:01.279965 t 2 \N t t f \N \N 1 0 7 2013-01-24 19:35:23 \N \N \N \N 0 0 0 2 \N \N f t f
-12 lowell 2013-01-31 20:38:33.750006 2013-01-31 23:39:41.112804 Lowell \N 47 2013-01-31 22:11:11.074018 lowell@mailinator.com c510193134d9347b917fde91ecfa63fd8580262ebbe757b911bfd0e3469daf3b 8c53b9af0df959d538fcb99ec20a9679 t lowell 1ca2db2d17c4df25c3002d0515cdbecb 2013-02-04 18:44:58 \N f 2013-01-31 20:38:44.603209 t 1 \N t t f \N \N 6 11 7 2013-01-31 23:39:41 \N \N \N \N 0 0 338768 2 108.18.225.101 \N f t f
-20 Clay 2013-02-01 04:35:15.52826 2013-02-01 18:37:25.374171 Clay \N 47 2013-02-04 18:00:51.857089 clay@mailinator.com c510193134d9347b917fde91ecfa63fd8580262ebbe757b911bfd0e3469daf3b 8c53b9af0df959d538fcb99ec20a9679 t clay 1ca2db2d17c4df25c3002d0515cdbecb 2013-02-04 18:00:19 \N f 2013-02-04 18:26:15.827878 t 1 \N t t f \N \N 5 17 7 2013-02-01 18:37:25 \N \N \N \N 0 0 307403 2 174.99.106.174 \N f t f
-14 jessamyn 2013-01-31 21:54:31.129088 2013-01-31 22:10:16.172254 JessamynSecond \N 47 2013-01-31 22:10:16.460181 jessamyn@mailinator.com c510193134d9347b917fde91ecfa63fd8580262ebbe757b911bfd0e3469daf3b 8c53b9af0df959d538fcb99ec20a9679 t jessamyn 1ca2db2d17c4df25c3002d0515cdbecb 2013-01-31 22:10:16 \N f 2013-01-31 21:59:40.780718 t 1 \N t t f \N \N 1 2 7 \N \N \N \N \N 0 0 185 1 \N \N f t f
-23 stienman 2013-02-04 18:41:40.094815 2013-02-04 18:41:40.134626 Adam Davis \N 47 2013-02-04 19:38:46.835615 stienman@mailinator.com c510193134d9347b917fde91ecfa63fd8580262ebbe757b911bfd0e3469daf3b 8c53b9af0df959d538fcb99ec20a9679 t stienman 1ca2db2d17c4df25c3002d0515cdbecb 2013-02-04 20:03:24 \N f \N t 1 \N t t f \N \N 6 10 7 \N \N \N \N \N 0 0 4585 1 50.77.241.137 \N f t f
-7 johnsmith 2013-01-31 19:43:10.344943 2013-02-01 21:06:52.196439 John Smith \N 47 2013-02-04 20:03:22.058651 johnsmith@mailinator.com c510193134d9347b917fde91ecfa63fd8580262ebbe757b911bfd0e3469daf3b 8c53b9af0df959d538fcb99ec20a9679 t johnsmith 1ca2db2d17c4df25c3002d0515cdbecb 2013-02-04 20:03:12 \N f 2013-01-31 19:46:05.421519 t 1 \N t t f \N \N 6 17 7 2013-02-01 21:06:52 \N \N \N \N 0 0 346618 3 50.148.146.96 \N f t f
-15 sam.saffron 2013-01-31 22:18:59.177595 2013-01-31 22:38:47.947069 Sam Saffron \N 47 \N sam.saffron@mailinator.com c510193134d9347b917fde91ecfa63fd8580262ebbe757b911bfd0e3469daf3b 8c53b9af0df959d538fcb99ec20a9679 t sam.saffron 1ca2db2d17c4df25c3002d0515cdbecb 2013-01-31 22:38:47 \N t 2013-01-31 22:19:00.662951 t 1 \N t t f \N \N 3 8 7 \N \N \N \N \N 0 0 24100 3 \N \N f t f
-11 pekka.gaiser 2013-01-31 20:25:26.284977 2013-01-31 22:03:43.918788 Pekka \N 47 2013-02-01 14:06:39.027174 pekka.gaiser@mailinator.com c510193134d9347b917fde91ecfa63fd8580262ebbe757b911bfd0e3469daf3b 8c53b9af0df959d538fcb99ec20a9679 t pekka.gaiser 1ca2db2d17c4df25c3002d0515cdbecb 2013-02-04 18:20:06 \N f 2013-02-01 14:13:35.357434 t 1 \N t t f \N \N 6 18 7 2013-02-04 10:55:41 \N \N \N \N 0 0 335743 5 141.70.15.48 \N f t f
-8 pekka 2013-01-31 20:11:44.021908 2013-01-31 20:11:44.021908 Pekka \N 47 \N pekka@mailinator.com c510193134d9347b917fde91ecfa63fd8580262ebbe757b911bfd0e3469daf3b 8c53b9af0df959d538fcb99ec20a9679 \N pekka 1ca2db2d17c4df25c3002d0515cdbecb \N \N f 2013-01-31 20:11:44.752331 t 1 \N t t f \N \N 0 0 7 \N \N \N \N \N 0 0 0 0 \N \N f t f
-10 pekka1980 2013-01-31 20:24:22.27334 2013-01-31 20:24:22.27334 pekka \N 47 \N pekka1980@mailinator.com c510193134d9347b917fde91ecfa63fd8580262ebbe757b911bfd0e3469daf3b 8c53b9af0df959d538fcb99ec20a9679 \N pekka1980 1ca2db2d17c4df25c3002d0515cdbecb \N \N f 2013-01-31 20:24:22.414254 t 1 \N t t f \N \N 0 0 7 \N \N \N \N \N 0 0 0 0 \N \N f t f
-13 jessamynyahoo 2013-01-31 21:51:14.543573 2013-01-31 21:51:27.190172 JessamynYahoo \N 47 \N jessamynyahoo@mailinator.com c510193134d9347b917fde91ecfa63fd8580262ebbe757b911bfd0e3469daf3b 8c53b9af0df959d538fcb99ec20a9679 t jessamynyahoo 1ca2db2d17c4df25c3002d0515cdbecb 2013-01-31 21:51:27 \N f 2013-01-31 21:51:25.424202 t 1 \N t t f \N \N 0 0 7 \N \N \N \N \N 0 0 0 1 \N \N f t f
[... diff too long, it was truncated ...]
GitHub sha: 113d0e02