From 5c65e2b761a77265d6652f45a1b0315622f87037 Mon Sep 17 00:00:00 2001 From: Daniel Supernault Date: Sun, 26 Dec 2021 00:08:18 -0700 Subject: [PATCH 1/3] Update SpaController, add username redirect method --- app/Http/Controllers/SpaController.php | 9 +++++++++ routes/web.php | 1 + 2 files changed, 10 insertions(+) diff --git a/app/Http/Controllers/SpaController.php b/app/Http/Controllers/SpaController.php index d92cdc37a..a6939513b 100644 --- a/app/Http/Controllers/SpaController.php +++ b/app/Http/Controllers/SpaController.php @@ -116,4 +116,13 @@ class SpaController extends Controller return (string) $converter->convertToHtml($file); }); } + + public function usernameRedirect(Request $request, $username) + { + $id = AccountService::usernameToId($username); + if(!$id) { + return redirect('/i/web/404'); + } + return redirect('/i/web/profile/' . $id); + } } diff --git a/routes/web.php b/routes/web.php index 328823853..c48b2017a 100644 --- a/routes/web.php +++ b/routes/web.php @@ -337,6 +337,7 @@ Route::domain(config('pixelfed.domain.app'))->middleware(['validemail', 'twofact Route::post('warning', 'AccountInterstitialController@read'); Route::get('my2020', 'SeasonalController@yearInReview'); + Route::get('web/username/{id}', 'SpaController@usernameRedirect'); Route::get('web/post/{id}', 'SpaController@webPost'); Route::get('web/profile/{id}', 'SpaController@webProfile'); Route::get('web/{q}', 'SpaController@index')->where('q', '.*'); From 0837b410b1b03188b149045150cc5677b3dac0a3 Mon Sep 17 00:00:00 2001 From: Daniel Supernault Date: Sun, 26 Dec 2021 00:16:04 -0700 Subject: [PATCH 2/3] Update SPA, rewrite autolink urls to SPA when applicable --- public/js/spa.js | Bin 1690196 -> 1690785 bytes public/mix-manifest.json | Bin 1983 -> 1983 bytes 2 files changed, 0 insertions(+), 0 deletions(-) diff --git a/public/js/spa.js b/public/js/spa.js index 2310736220ccd34b678769b2d7b88e13027b5514..6c77152513fe9cfaadf8bc46dfac767415c7f3af 100644 GIT binary patch delta 776 zcmcJNK}#D!7=}rsX-#z#O{?)DGE&`*+fBUmPzfl4c(4UqZ_>jieody`%-Wf6wIWMZ z2E6G(amcCoAF6vU*niNXx88g6?8VUrOawg$9-hnhG4DL{GQamK2ldLjjLAnbF56_g zOvuObiR_R``BZkwt{=wqVfPY;cfb~bzh3s~;$Xp6^;~?ai^B@12(y%Z7N&YT8ei(P zn`UaxZqKUIL&J#K>R>uK_zE1#81R|-H?u{w!TAyZUwscAl+ovto@b7@3uVt0B3C3; zS5(ohkPjp3XC{{2-A*OGITgT3L{3Wqf=Q5~2gDjDL!?*)M+7B-+$`8**6^?i*OM{J zveDsC^OvFdxXX1Ox!j4C+$x8U#3p%~Ux8A-A(AJf4p^a%y4$-345`mry|11<4_|Sd zOgyA(Ab>Ns23oes^~J3vdsN^{;RQEpzM*^FWTV^rm)RnC)h1S{aLPVI-J8D14>0ln zhp10S#-C(kV}+qQ3wwsPL}X}EnzW`{)1%2~o<$;he$LfEn4XJ{bG?3>`o58#QEV;M fq5hs^47I+WN~pfg^uMj0La(MzlZ|!?{lDrL;xG;( delta 177 zcmZ2DGyTex^oAD37N!>F7M2#)7Pc1l7LFFq7OocV7M>Q~EqrcUx6jmK)?l1|We49y z!Qzs{lG0+m4MNK8mv-_2F+UIs0I?tt3jwh(5Q}WTv{UqV(RABC zLXy)J*7C7V*U4qmp8kF^E5~+8U9l1t9vuT6rIMWdBr7HD%;|nSYrD Date: Sun, 26 Dec 2021 00:16:36 -0700 Subject: [PATCH 3/3] Update changelog --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index bdc26e2ca..1ea783177 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -60,6 +60,7 @@ - Updated StatusEntityLexer, prevent boosts and replies from being added to PublicTimelineService. ([32707372](https://github.com/pixelfed/pixelfed/commit/32707372)) - Updated SpaController, persist web language changes. ([7bc684e5](https://github.com/pixelfed/pixelfed/commit/7bc684e5)) - Update LoginController, bump decayMinutes from 1 to 60. ([6bf92bed](https://github.com/pixelfed/pixelfed/commit/6bf92bed)) +- Update SPA, rewrite autolink urls to SPA when applicable. ([0837b410](https://github.com/pixelfed/pixelfed/commit/0837b410)) - ([](https://github.com/pixelfed/pixelfed/commit/)) ## [v0.11.1 (2021-09-07)](https://github.com/pixelfed/pixelfed/compare/v0.11.0...v0.11.1)