From bdec78734d09385ed6b58703138a26e57fbb321e Mon Sep 17 00:00:00 2001 From: Victor Costa Date: Tue, 14 Apr 2015 14:17:18 -0300 Subject: [PATCH] oauth_client: generate private token for api access --- plugins/oauth_client/lib/oauth_client_plugin.rb | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/plugins/oauth_client/lib/oauth_client_plugin.rb b/plugins/oauth_client/lib/oauth_client_plugin.rb index ec44939..97ac407 100644 --- a/plugins/oauth_client/lib/oauth_client_plugin.rb +++ b/plugins/oauth_client/lib/oauth_client_plugin.rb @@ -30,7 +30,11 @@ class OauthClientPlugin < Noosfero::Plugin end def body_ending - session.delete(:oauth_client_login) ? "" : '' + if session.delete(:oauth_client_login) + current_user.private_token_expired? if current_user.present? + private_token = current_user.present? ? current_user.private_token : '' + "" + end end def js_files -- libgit2 0.21.2