Permalink
Browse files

use getCanonicalProtocol for authorisation URL protocol

  • Loading branch information...
justincarter committed Feb 7, 2019
1 parent da5e911 commit 382624a3cd0580bd8b98899d4da6f637978f5f0a
Showing with 4 additions and 4 deletions.
  1. +1 −1 packages/security/GoogleUserDirectory.cfc
  2. +3 −3 webskin/gudLogin/displayLogin.cfm
@@ -343,7 +343,7 @@

<cffunction name="getRedirectURL" access="public" output="false" returntype="string" hint="For use with getAuthorisationURL and getRefreshToken">

<cfreturn "http://#cgi.http_host##application.url.webroot#/index.cfm?type=gudLogin&view=displayLogin" />
<cfreturn "#application.fc.lib.seo.getCanonicalProtocol()#://#cgi.http_host##application.url.webroot#/index.cfm?type=gudLogin&view=displayLogin" />
</cffunction>

<cffunction name="throwError" access="private" output="false" returntype="void">
@@ -51,16 +51,16 @@ START WEBSKIN
<cfif application.security.userdirectories.gud.isEnabled()>
<!--- run authenticate function? --->
<cfif isdefined("url.logout")>
<cfoutput><p class="error">You are logged out. <a href="http://#cgi.http_host#/index.cfm?type=gudLogin&view=displayLogin">Login again</a></p></cfoutput>
<cfoutput><p class="error">You are logged out. <a href="/index.cfm?type=gudLogin&view=displayLogin">Login again</a></p></cfoutput>
<cfelseif isdefined("url.code") and not isdefined("arguments.stParam.message")>
<cfset arguments.stParam = application.security.processLogin() />
<cfif arguments.stParam.authenticated and not request.mode.profile>
<cflocation url="#URLDecode(arguments.stParam.loginReturnURL)#" addtoken="false" />
<cfelse>
<cfoutput><p class="error">#arguments.stParam.message# <a href="http://#cgi.http_host#/index.cfm?type=gudLogin&view=displayLogin">Retry</a></p></cfoutput>
<cfoutput><p class="error">#arguments.stParam.message# <a href="/index.cfm?type=gudLogin&view=displayLogin">Retry</a></p></cfoutput>
</cfif>
<cfelse>
<cflocation url="#application.security.userdirectories.gud.getAuthorisationURL(clientID=application.fapi.getConfig('GUD', 'clientid'),redirectURL='http://#cgi.http_host#/index.cfm?type=gudLogin&view=displayLogin',scope='https://www.googleapis.com/auth/userinfo.profile https://www.googleapis.com/auth/userinfo.email',state='')#" addtoken="false" />
<cflocation url="#application.security.userdirectories.gud.getAuthorisationURL(clientID=application.fapi.getConfig('GUD', 'clientid'),redirectURL=application.security.userdirectories.googleud.getRedirectURL(),scope='https://www.googleapis.com/auth/userinfo.profile https://www.googleapis.com/auth/userinfo.email',state='')#" addtoken="false" />
</cfif>
<cfelse>
<cfoutput>

0 comments on commit 382624a

Please sign in to comment.