Skip to content
This repository has been archived by the owner on Aug 20, 2019. It is now read-only.

possible bug: db reset needed to authenticate #74

Open
atruskie opened this issue Dec 30, 2012 · 1 comment
Open

possible bug: db reset needed to authenticate #74

atruskie opened this issue Dec 30, 2012 · 1 comment

Comments

@atruskie
Copy link
Member

Why does the db need to be reset (rake db:drop db:create db:migrate db:seed) in order to authenticate.

So I get that a feature related to migration might screw up if the db is not migrated properly...

But when there is no changes to the authentication tables, it should work fine....

Instead, when trying to authenticate, our custom "close popup window" view fails, instead redirecting to the home page.

The obvious fix is just reset the db every time... but when we get to a production environment that will not be feasible. We have to migrate only (not drop, create, or seed). So whatever is "patching" this problem when we reset needs to be discovered.

@atruskie
Copy link
Member Author

atruskie commented Mar 5, 2013

2013-03-05 10:17:32.398 [INFO ] Processing by Api::CallbacksController#open_id as HTML (pid:9876)
2013-03-05 10:17:32.408 [INFO ] Parameters: {"openid_url"=>"https://www.google.com/accounts/o8/id"} (pid:9876)
2013-03-05 10:17:32.408 [WARN ] WARNING: Can't verify CSRF token authenticity (pid:9876)
2013-03-05 10:17:32.147 [DEBUG] Authorization Load (0.0ms) SELECT "authorizations".* FROM "authorizations" WHERE "authorizations"."uid" = 'https://www.google.com/accounts/o8/id?id=AItOawkQXG35m0fH7JsCbJD4XM3eofvhR2eGoGs' AND "authorizations"."provider" = 'open_id' LIMIT 1 (pid:9876)
2013-03-05 10:17:32.262 [DEBUG] User Load (1.0ms) SELECT "users".* FROM "users" WHERE "users"."id" = 6 AND ("users"."deleted_at" IS NULL) LIMIT 1 (pid:9876)
2013-03-05 10:17:32.287 DEBUG begin transaction (pid:9876)
2013-03-05 10:17:32.436 [DEBUG] User Exists (1.0ms) SELECT 1 AS one FROM "users" WHERE (LOWER("users"."user_name") = LOWER('Anthony_Truskinger_open_id') AND "users"."id" != 6) LIMIT 1 (pid:9876)
2013-03-05 10:17:32.442 DEBUG UPDATE "users" SET "encrypted_password" = '$2a$10$nrQnMbL.fJG67tgC.RZMduqlGM3xXAJ2Ql6SCuHOMs.OgXcIqdMDS', "updated_at" = '2013-03-05 00:17:32.437613' WHERE "users"."id" = 6 (pid:9876)
2013-03-05 10:17:32.490 DEBUG commit transaction (pid:9876)
2013-03-05 10:17:32.543 [DEBUG] Authorization Load (0.0ms) SELECT "authorizations".* FROM "authorizations" WHERE "authorizations"."user_id" = 6 AND "authorizations"."provider" = 'open_id' AND "authorizations"."uid" = 'https://www.google.com/accounts/o8/id?id=AItOawkQXG35m0fH7JsCbJD4XM3eofvhR2eGoGs' LIMIT 1 (pid:9876)
2013-03-05 10:17:32.544 DEBUG begin transaction (pid:9876)
2013-03-05 10:17:32.548 [DEBUG] Authorization Exists (0.0ms) SELECT 1 AS one FROM "authorizations" WHERE (LOWER("authorizations"."uid") = LOWER('https://www.google.com/accounts/o8/id?id=AItOawkQXG35m0fH7JsCbJD4XM3eofvhR2eGoGs') AND "authorizations"."id" != 1 AND "authorizations"."provider" = 'open_id') LIMIT 1 (pid:9876)
2013-03-05 10:17:32.549 [DEBUG] Authorization Exists (0.0ms) SELECT 1 AS one FROM "authorizations" WHERE (LOWER("authorizations"."name") = LOWER('Anthony Truskinger') AND "authorizations"."id" != 1 AND "authorizations"."provider" = 'open_id') LIMIT 1 (pid:9876)
2013-03-05 10:17:32.551 [DEBUG] Authorization Exists (0.0ms) SELECT 1 AS one FROM "authorizations" WHERE (LOWER("authorizations"."link") = LOWER('https://www.google.com/accounts/o8/id?id=AItOawkQXG35m0fH7JsCbJD4XM3eofvhR2eGoGs') AND "authorizations"."id" != 1) LIMIT 1 (pid:9876)
2013-03-05 10:17:32.552 DEBUG commit transaction (pid:9876)
2013-03-05 10:17:32.554 [INFO ] Completed 401 Unauthorized in 514ms (pid:9876

Started GET "/security/sign_in" for 127.0.0.1 at 2013-03-05 10:17:32 +1000 (pid:9876)

This line is from a log.... it should never happen

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

1 participant