lib/warden-github/strategy.rb in warden-github-0.10.2 vs lib/warden-github/strategy.rb in warden-github-0.11.0

- old
+ new

@@ -11,10 +11,13 @@ env['rack.session']['github_oauth_state'].size > 0 && params['state'] == env['rack.session']['github_oauth_state']) 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 else env['rack.session']['github_oauth_state'] = state