Permalink
Browse files

nuke bio before initializing the user object

  • Loading branch information...
1 parent 7132634 commit 56e536c76f645871bbef27637626a1b0e0eb5753 @atmos committed Sep 20, 2012
Showing with 5 additions and 7 deletions.
  1. +4 −1 lib/warden-github/strategy.rb
  2. +0 −5 lib/warden-github/user.rb
  3. +1 −1 lib/warden-github/version.rb
@@ -13,7 +13,10 @@ def authenticate!
begin
api = api_for(params['code'])
- success!(Warden::Github::Oauth::User.new(Yajl.load(user_info_for(api.token)), api.token))
+ user_info = Yajl.load(user_info_for(api.token))
+ user_info.delete('bio') # Delete bio, as it can easily make the session cookie too long.
+
+ success!(Warden::Github::Oauth::User.new(user_info, api.token))
rescue OAuth2::Error
%(<p>Outdated ?code=#{params['code']}:</p><p>#{$!}</p><p><a href="/auth/github">Retry</a></p>)
end
@@ -6,11 +6,6 @@ module Warden
module Github
module Oauth
class User < Struct.new(:attribs, :token)
- def initialize(attributes, api_token)
- attributes.delete('bio') # Delete bio, as it can easily make the session cookie too long.
- super(attributes, api_token)
- end
-
def login
attribs['login']
end
@@ -1,5 +1,5 @@
module Warden
module Github
- VERSION = "0.10.2"
+ VERSION = "0.11.0"
end
end

0 comments on commit 56e536c

Please sign in to comment.