diff --git a/app/controllers/rs/oauth_controller.rb b/app/controllers/rs/oauth_controller.rb index 2aa25e0..e083ef6 100644 --- a/app/controllers/rs/oauth_controller.rb +++ b/app/controllers/rs/oauth_controller.rb @@ -1,5 +1,5 @@ class Rs::OauthController < ApplicationController - before_action :require_user_signed_in + before_action :require_signed_in_with_username def new username, org = params[:useraddress].split("@") @@ -97,6 +97,13 @@ class Rs::OauthController < ApplicationController 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) url = "#{auth.url}#remotestorage=#{current_user.address}" url += "&access_token=#{auth.token}"