Commit 69d314b1 authored by Dmitriy Brodnitskiy's avatar Dmitriy Brodnitskiy

add redirect after login

parent f204885d
......@@ -6,6 +6,7 @@ class RedmineOauthController < AccountController
include Helpers::Checker
def oauth_google
if Setting.plugin_redmine_omniauth_google[:oauth_authentification]
session[:back_url] = params[:back_url]
redirect_to oauth_client.auth_code.authorize_url(:redirect_uri => oauth_google_callback_url, :scope => scopes)
else
password_authentication
......@@ -30,6 +31,8 @@ class RedmineOauthController < AccountController
end
def try_to_login info
params[:back_url] = session[:back_url]
session.delete(:back_url)
user = User.find_or_initialize_by_mail(info["email"])
if user.new_record?
# Self-registration off
......
<%= stylesheet_link_tag 'buttons', :plugin => 'redmine_omniauth_google' %>
<% if Setting.plugin_redmine_omniauth_google[:oauth_authentification] %>
<%= link_to oauth_google_path do %>
<%= link_to oauth_google_path(:back_url => back_url) do %>
<%= button_tag :class => 'button-login' do %>
<%= image_tag('/plugin_assets/redmine_omniauth_google/images/google_login_icon.png', :class => 'button-login-icon', :alt => l(:login_via_google)) %>
<%= content_tag :div, l(:login_via_google), :class => 'button-login-text' %>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment