Closed oxanayoxana closed 5 years ago
Looks good to me. @oxanayoxana - my understanding is that it shouldn't conflict with @hkopij PR and I can merge both, you agree?
There seem to be some empty, generated files - can we remove them if they are not used?
Looks good to me. @oxanayoxana - my understanding is that it shouldn't conflict with @hkopij PR and I can merge both, you agree?
Yes, I think they won't conflict and both can be merged!
Today I experienced problems retrieving the repos. The same error Octokit::Unauthorized. So I tried to sign out and check again, but couldn't sign in anymore. For some unknown reasons it started to give me rollbacks:
↳ app/models/user.rb:9
(0.4ms) BEGIN
↳ app/models/user.rb:9
User Exists (1.1ms) SELECT 1 AS one FROM "users" WHERE "users"."email" = $1 LIMIT $2 [["email", "oksana.oleshchenko@gmail.com"], ["LIMIT", 1]]
↳ app/models/user.rb:9
(0.4ms) ROLLBACK
↳ app/models/user.rb:9
Redirected to http://localhost:3000/
Completed 302 Found in 494ms (ActiveRecord: 115.1ms)
I found this solution https://github.com/omniauth/omniauth/issues/816#issuecomment-293420970 and changed def self.from_omniauth(auth)
in User Model to this one:
def self.from_omniauth(auth)
where(email: auth.info.email).first_or_initialize.tap do |user|
user.uid = auth.info.nickname
user.email = auth.info.email
user.password = Devise.friendly_token[0,20]
user.save!
end
end
Locally it started to work. Both sign in works and repos get fetched. If I delete user.save!
it gives me Completed 200 OK
in logs but does not log in.
Don't know if I'm the only one experiencing this. I haven't commited nor pushed anything yet, we can wait and see if anyone has the same problem.
I had a similar problem but I didn’t understand the reasons. Great problem analysis!
@oxanayoxana - after merging other PRs there seems to be a conflict on Gemfile.lock now, could you look at it - I'd be happy to merge
Thank you!
created Repositories Controller with new action, which fetches current_user repositories (thanks @skrix for help with that)
I know we have an open pull request for part of this issue, so you may take a look at this one after.
When both are merged, the next step could be to create a fill-in-form for Project. Opensource mentor gets redirected to this fill-in-form after you press button "Add this repo". In this form opensource mentor adds his name, and description to the repo he is adding. Will create issue for this.