RS OAuth pre-fills username for login
This commit is contained in:
parent
a2d27bf575
commit
5f921f1b53
@ -1,5 +1,5 @@
|
|||||||
class Rs::OauthController < ApplicationController
|
class Rs::OauthController < ApplicationController
|
||||||
before_action :require_user_signed_in
|
before_action :require_signed_in_with_username
|
||||||
|
|
||||||
def new
|
def new
|
||||||
username, org = params[:useraddress].split("@")
|
username, org = params[:useraddress].split("@")
|
||||||
@ -97,6 +97,13 @@ class Rs::OauthController < ApplicationController
|
|||||||
|
|
||||||
private
|
private
|
||||||
|
|
||||||
|
def require_signed_in_with_username
|
||||||
|
unless user_signed_in?
|
||||||
|
username, org = params[:useraddress].split("@")
|
||||||
|
redirect_to new_user_session_path(cn: username, ou: org)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
def app_auth_url(auth)
|
def app_auth_url(auth)
|
||||||
url = "#{auth.url}#remotestorage=#{current_user.address}"
|
url = "#{auth.url}#remotestorage=#{current_user.address}"
|
||||||
url += "&access_token=#{auth.token}"
|
url += "&access_token=#{auth.token}"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user