Toggle navigation
Toggle navigation
This project
Loading...
Sign in
Зуев Егор
/
wiki.dev
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Snippets
Network
Create a new issue
Commits
Issue Boards
Files
Commits
Network
Compare
Branches
Tags
Authored by
Dan Brown
2016-08-21 14:49:40 +0100
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
Commit
f8a299caee677bbbd10ac912856176a65b9f7e95
f8a299ca
1 parent
437dce77
Fixed login 'intended' redirect for custom urls.
Also changed social account detach wording.
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
15 additions
and
5 deletions
app/Http/Controllers/Auth/AuthController.php
app/Services/SocialAuthService.php
app/helpers.php
app/Http/Controllers/Auth/AuthController.php
View file @
f8a299c
...
...
@@ -145,7 +145,9 @@ class AuthController extends Controller
auth
()
->
login
(
$user
);
}
return
redirect
()
->
intended
(
$this
->
redirectPath
());
$path
=
session
()
->
pull
(
'url.intended'
,
'/'
);
$path
=
baseUrl
(
$path
,
true
);
return
redirect
(
$path
);
}
/**
...
...
app/Services/SocialAuthService.php
View file @
f8a299c
...
...
@@ -215,7 +215,7 @@ class SocialAuthService
{
session
();
auth
()
->
user
()
->
socialAccounts
()
->
where
(
'driver'
,
'='
,
$socialDriver
)
->
delete
();
\Session
::
flash
(
'success'
,
$socialDriver
.
' account successfully detached'
);
session
()
->
flash
(
'success'
,
title_case
(
$socialDriver
)
.
' account successfully detached'
);
return
redirect
(
auth
()
->
user
()
->
getEditUrl
());
}
...
...
app/helpers.php
View file @
f8a299c
...
...
@@ -64,13 +64,21 @@ function setting($key, $default = false)
/**
* Helper to create url's relative to the applications root path.
* @param $path
* @param string $path
* @param bool $forceAppDomain
* @return string
*/
function
baseUrl
(
$path
)
function
baseUrl
(
$path
,
$forceAppDomain
=
false
)
{
if
(
strpos
(
$path
,
'http'
)
===
0
)
return
$path
;
$isFullUrl
=
strpos
(
$path
,
'http'
)
===
0
;
if
(
$isFullUrl
&&
!
$forceAppDomain
)
return
$path
;
$path
=
trim
(
$path
,
'/'
);
if
(
$isFullUrl
&&
$forceAppDomain
)
{
$explodedPath
=
explode
(
'/'
,
$path
);
$path
=
implode
(
'/'
,
array_splice
(
$explodedPath
,
3
));
}
return
rtrim
(
config
(
'app.url'
),
'/'
)
.
'/'
.
$path
;
}
...
...
Please
register
or
sign in
to post a comment