Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F2896497
PhabricatorAuthOldOAuthRedirectController.php
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Award Token
Flag For Later
Advanced/Developer...
View Handle
View Hovercard
Size
1 KB
Referenced Files
None
Subscribers
None
PhabricatorAuthOldOAuthRedirectController.php
View Options
<?php
final
class
PhabricatorAuthOldOAuthRedirectController
extends
PhabricatorAuthController
{
public
function
shouldRequireLogin
(
)
{
return
false
;
}
public
function
shouldAllowRestrictedParameter
(
$parameter_name
)
{
if
(
$parameter_name
==
'code'
)
{
return
true
;
}
return
parent
::
shouldAllowRestrictedParameter
(
$parameter_name
)
;
}
public
function
handleRequest
(
AphrontRequest
$request
)
{
$viewer
=
$this
->
getViewer
(
)
;
$provider
=
$request
->
getURIData
(
'provider'
)
;
// TODO: Most OAuth providers are OK with changing the redirect URI, but
// Google and GitHub are strict. We need to respect the old OAuth URI until
// we can get installs to migrate. This just keeps the old OAuth URI working
// by redirecting to the new one.
$provider_map
=
array
(
'google'
=>
'google:google.com'
,
'github'
=>
'github:github.com'
,
)
;
if
(
!
isset
(
$provider_map
[
$provider
]
)
)
{
return
new
Aphront404Response
(
)
;
}
$provider_key
=
$provider_map
[
$provider
]
;
$uri
=
$this
->
getRequest
(
)
->
getRequestURI
(
)
;
$uri
->
setPath
(
$this
->
getApplicationURI
(
'login/'
.
$provider_key
.
'/'
)
)
;
return
id
(
new
AphrontRedirectResponse
(
)
)
->
setURI
(
$uri
)
;
}
}
File Metadata
Details
Attached
Mime Type
text/x-php
Expires
Jan 19 2025, 23:12 (6 w, 3 d ago)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
1129741
Default Alt Text
PhabricatorAuthOldOAuthRedirectController.php (1 KB)
Attached To
Mode
rP Phorge
Attached
Detach File
Event Timeline
Log In to Comment