- unless @token.invalidated?
- if request.post?
- if user_authorizes_token?
- @token.authorize!(current_user)
- if @token.oauth10?
- callback_url = params[:oauth_callback] || @token.client_application.callback_url
- else
- callback_url = @token.oob? ? @token.client_application.callback_url : @token.callback_url
- end
- @redirect_url = URI.parse(callback_url) unless callback_url.blank?
+ if @token.invalidated?
+ @message = t "oauth.oauthorize_failure.invalid"
+ render :action => "authorize_failure"
+ elsif request.post?
+ if user_authorizes_token?
+ @token.authorize!(current_user)
+ callback_url = if @token.oauth10?
+ params[:oauth_callback] || @token.client_application.callback_url
+ else
+ @token.oob? ? @token.client_application.callback_url : @token.callback_url
+ end
+ @redirect_url = URI.parse(callback_url) if callback_url.present?