mirror of
https://github.com/lingble/chatwoot.git
synced 2025-10-30 18:47:51 +00:00
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Co-authored-by: Muhsin Keloth <muhsinkeramam@gmail.com>
20 lines
533 B
Ruby
20 lines
533 B
Ruby
class Api::V1::Accounts::Microsoft::AuthorizationsController < Api::V1::Accounts::OauthAuthorizationController
|
|
include MicrosoftConcern
|
|
|
|
def create
|
|
redirect_url = microsoft_client.auth_code.authorize_url(
|
|
{
|
|
redirect_uri: "#{base_url}/microsoft/callback",
|
|
scope: scope,
|
|
state: state,
|
|
prompt: 'consent'
|
|
}
|
|
)
|
|
if redirect_url
|
|
render json: { success: true, url: redirect_url }
|
|
else
|
|
render json: { success: false }, status: :unprocessable_entity
|
|
end
|
|
end
|
|
end
|