From 5731b9b1c73fa6b2414248c98a0c42714e964455 Mon Sep 17 00:00:00 2001 From: Alex Gleason Date: Tue, 19 Apr 2022 14:37:48 -0500 Subject: [PATCH] Redirect all /auth routes --- app/soapbox/actions/auth.js | Bin 10240 -> 10275 bytes app/soapbox/actions/external_auth.js | Bin 4664 -> 4665 bytes app/soapbox/components/sidebar_menu.tsx | 2 +- app/soapbox/containers/soapbox.js | Bin 8875 -> 8652 bytes .../auth_login/components/login_page.js | Bin 2598 -> 2599 bytes .../features/auth_login/components/logout.tsx | 28 ++++++++++++++++++ app/soapbox/features/public_layout/index.js | Bin 2183 -> 2184 bytes app/soapbox/features/security/mfa_form.js | Bin 12354 -> 12358 bytes app/soapbox/features/settings/index.js | Bin 3833 -> 3837 bytes .../features/ui/components/link_footer.tsx | 2 +- .../ui/components/profile-dropdown.tsx | 2 +- app/soapbox/features/ui/index.js | Bin 28632 -> 29926 bytes .../features/ui/util/async-components.js | Bin 15719 -> 15853 bytes .../features/verification/waitlist_page.js | Bin 2869 -> 2862 bytes 14 files changed, 31 insertions(+), 3 deletions(-) create mode 100644 app/soapbox/features/auth_login/components/logout.tsx diff --git a/app/soapbox/actions/auth.js b/app/soapbox/actions/auth.js index 5c0fc467a5e945210c527c59c6e93b54639d4d11..00f9c606d08961506a27d5032452d183079b5958 100644 GIT binary patch delta 37 tcmZn&SRAlnp(0Oanu3O6VsdhRX6> diff --git a/app/soapbox/actions/external_auth.js b/app/soapbox/actions/external_auth.js index 8bf0bba3f9b8af2a97cd7d26bbf0ec9bb507a50a..4f389667f81db6fccb06d04e47e1888360694ff2 100644 GIT binary patch delta 18 Zcmdm?vQuRP2ODcnetKr!W*#;j9soRu1(N^( delta 17 Ycmdm~vO{G92OCRbX-URrUN#*b05$3bEC2ui diff --git a/app/soapbox/components/sidebar_menu.tsx b/app/soapbox/components/sidebar_menu.tsx index c31ec29dbf..e7cec5d959 100644 --- a/app/soapbox/components/sidebar_menu.tsx +++ b/app/soapbox/components/sidebar_menu.tsx @@ -285,7 +285,7 @@ const SidebarMenu: React.FC = (): JSX.Element | null => {
ky { + const intl = useIntl(); + const dispatch = useDispatch(); + const [done, setDone] = useState(false); + + useEffect(() => { + (dispatch(logOut(intl)) as any) + .then(() => setDone(true)) + .catch(console.warn); + }); + + if (done) { + return ; + } else { + return ; + } +}; + +export default Logout; diff --git a/app/soapbox/features/public_layout/index.js b/app/soapbox/features/public_layout/index.js index 735ccdb2f91cd1b862e25bc7d5d7080317b7827c..d7ff351555943cc7902e7545b77ac5827813f041 100644 GIT binary patch delta 18 ZcmZn{>=4}Wl9@FpKRq*V^IPUwEC5432Q2^q delta 17 YcmeAWY!}?{l9?s3v?OEmJLXv|06aa42DeG&4(LX-URrWoBhv06&HW_5c6? diff --git a/app/soapbox/features/settings/index.js b/app/soapbox/features/settings/index.js index f78cddad7d763722df5fcff93654de99ea91e8c4..92a10f90ab8464e90f70e166aa202e310ef16bfc 100644 GIT binary patch delta 16 Ycmew<`&V{@F8k!OY@C~o*pIUV06hB!J^%m! delta 25 hcmew>`%`v { {(features.federating && features.accountMoving) && ( )} - + } diff --git a/app/soapbox/features/ui/components/profile-dropdown.tsx b/app/soapbox/features/ui/components/profile-dropdown.tsx index 850f546111..71d5c1101e 100644 --- a/app/soapbox/features/ui/components/profile-dropdown.tsx +++ b/app/soapbox/features/ui/components/profile-dropdown.tsx @@ -87,7 +87,7 @@ const ProfileDropdown: React.FC = ({ account, children }) => { menu.push({ text: intl.formatMessage(messages.logout, { acct: account.acct }), - to: '/auth/sign_out', + to: '/logout', action: handleLogOut, icon: require('@tabler/icons/icons/logout.svg'), }); diff --git a/app/soapbox/features/ui/index.js b/app/soapbox/features/ui/index.js index af27d453a16ff14c5bd01eb98cfaef554fb80827..9af173cb3798a77dc1a5ef9112d8339272cdd70e 100644 GIT binary patch delta 1086 zcmZ`%O=}ZT6eW^=5H;4?mIP_MrXe-8&7feWRwA@m?V?}Qk1hn$mzkH$(3$s!c`r?| zg#HEPf-Av=8^KL+euqkTx>6AY7cTqK2S` z%FJ>K)KAfDT2z5e(`HRzv>jo^G_(W-62ldgNHDqLQM#~iaMo~aL-ttOwzO3HHsfv9 zlZdFMq27{kXAOL6+CDYp$tj|i9?8*!2KRj`JkG+I4DPB=$|Mk>6dJ^F>SW2-ju%+m zoePK69Nx4U*i1-DOyCXBNK0Cgek>l=x?V)>IGdU43xT+k+3cq-v7H$#WjF93Gv2Qr zl#_UVA(x8%r-7Lz$#Zaz)S;=2_5@669sHUd4L*!7B!}Zb+O!_67p&ypCoYFec0J$I zrsAOPE<)UfEBQ-!Q0NP03r|nsU}Y5j?C?OhTS?(+K8N3m<6|+suR^41E$~Q_hS*G1 z!&Q9<-xW3dT$!&5Dy2$QXtK>~4Pr>{*Sd}fpSdPpd;){ta zgyeKrQlAm$nA~PsRK#ZmxEMAm+y7%LKGD;7MJM>ZlndTY4yLhF8o_Gi5&kNT1#k3g VNj%Kl4-RkX2~`;h9#=cp{{X=BdCUL+ delta 256 zcmaF%lJUlU#trOzn??D|xF%1NG-XLFEy9A~ellNw^4N6VPEJ{r-DON};%Fk8sO)M_SPsz{IQ3%LM1qvi8xVh>m zq?RP>DU{?Zq-9npwrYg62t7;X~ zWFAfZ$<-RNlT&p1!8Qu%aqvx+*0Gr^rlB`^k&Dt~1DlY^*%|_q)3wYd*JyH1cG0w$ yd{UQh@?_n_$s2SzC+~9>nJnkXv3Y@wHp^x;M}0=H>a!a9lkZ!JY|eD5H39(jU0M_X diff --git a/app/soapbox/features/ui/util/async-components.js b/app/soapbox/features/ui/util/async-components.js index 17f54d3f4bae5d0894cb31f9fc8b11627876ac84..cd202afb57a3d717a47e9e5e2ce89626b680bc42 100644 GIT binary patch delta 41 ucmaD}^|pG$bU99+{Pg_Nl7PhY$qSfGC-bXlv*mzACJV|+Zk{Q3P7VNUn-BH? delta 12 TcmaD`{k&?!bh*v4@)zU)E+hsF diff --git a/app/soapbox/features/verification/waitlist_page.js b/app/soapbox/features/verification/waitlist_page.js index 819e6af85c7e22b82a8f80b9e01650c19b4e45b5..01b71bcaed6f5f24dc99d0177df1a87fd7a22b9b 100644 GIT binary patch delta 16 XcmdlgwoYsV4;yn%e)?uHHhES6EoKCY delta 23 ecmZ1{wpDBc4;xovX-S5Dab|j6{APYOc~$^ktp_;(