Skip to content

Commit

Permalink
Change link to MS App Access/Revoke page
Browse files Browse the repository at this point in the history
  • Loading branch information
drnic committed Nov 13, 2024
1 parent 625e264 commit 858e9d9
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
class Authentications::MicrosoftGraphOauthController < ApplicationController
allow_unauthenticated_access

# GET /auth/microsoft_graph/callback
def create
if Current.user
Current.user.microsoft_graph_credential&.destroy
Expand Down Expand Up @@ -30,7 +31,7 @@ def create
@person&.errors&.delete :personable
msg = @person.errors.full_messages.map { |m| m.gsub(/Personable |credentials /, "") }.to_sentence.capitalize
if msg.downcase.include?("oauth refresh token can't be blank")
msg += " " + helpers.link_to("Microsoft third-party connections", "https://microsoft.com/consent", class: "underline") + " search for website, and delete all it's connections. Then try again."
msg += " " + helpers.link_to("Microsoft third-party connections", "https://account.microsoft.com/privacy/app-access", class: "underline") + " search for website, and delete all it's connections. Then try again."
end

redirect_to new_user_path, alert: msg
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ class Authentications::MicrosoftGraphOauthControllerTest < ActionDispatch::Integ
end

test "should log you in for a user that exists" do
OmniAuth.config.add_mock(:microsoft_graph, { uid: credentials(:keith_microsoft_graph).oauth_id }) #, info: { email: "[email protected]", first_name: "John", last_name: "Doe" }})
OmniAuth.config.add_mock(:microsoft_graph, { uid: credentials(:keith_microsoft_graph).oauth_id })
assert_no_difference "Credential.count" do
assert_difference "Authentication.count", 1 do
assert_difference "Client.count", 1 do
Expand Down

0 comments on commit 858e9d9

Please sign in to comment.