diff --git a/CHANGELOG.md b/CHANGELOG.md index 5522fd453..a62048b6a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -38,6 +38,7 @@ - Updated checkpoint view, fix recovery code bug ([3385583f](https://github.com/pixelfed/pixelfed/commit/3385583f)) - Updated Inbox, move expensive HTTP Signature validation to job queue ([f2ae45e5a](https://github.com/pixelfed/pixelfed/commit/f2ae45e5a)) - Updated MomentUI, fix bugs and improve UI ([90b89cb8](https://github.com/pixelfed/pixelfed/commit/90b89cb8)) +- Updated PostComponent, improve embed model. Fixes ([#2189](https://github.com/pixelfed/pixelfed/issues/2189)) ([b12e504e](https://github.com/pixelfed/pixelfed/commit/b12e504e)) ## [v0.10.9 (2020-04-17)](https://github.com/pixelfed/pixelfed/compare/v0.10.8...v0.10.9) diff --git a/app/Http/Controllers/AccountController.php b/app/Http/Controllers/AccountController.php index a554f17d8..a18380763 100644 --- a/app/Http/Controllers/AccountController.php +++ b/app/Http/Controllers/AccountController.php @@ -446,12 +446,16 @@ class AccountController extends Controller } if($request->session()->has('2fa.attempts')) { - $count = (int) $request->session()->has('2fa.attempts'); - $request->session()->push('2fa.attempts', $count + 1); + $count = (int) $request->session()->get('2fa.attempts'); + if($count == 3) { + Auth::logout(); + return redirect('/'); + } + $request->session()->put('2fa.attempts', $count + 1); } else { - $request->session()->push('2fa.attempts', 1); + $request->session()->put('2fa.attempts', 1); } - return redirect()->back()->withErrors([ + return redirect('/i/auth/checkpoint')->withErrors([ 'code' => 'Invalid code' ]); } diff --git a/public/js/status.js b/public/js/status.js index 7e1a772d0..441c36964 100644 Binary files a/public/js/status.js and b/public/js/status.js differ diff --git a/public/mix-manifest.json b/public/mix-manifest.json index de81b6eb5..f4f48a1e6 100644 Binary files a/public/mix-manifest.json and b/public/mix-manifest.json differ diff --git a/resources/assets/js/components/PostComponent.vue b/resources/assets/js/components/PostComponent.vue index b3e834ede..1c5a3ff29 100644 --- a/resources/assets/js/components/PostComponent.vue +++ b/resources/assets/js/components/PostComponent.vue @@ -512,7 +512,29 @@ size="md" body-class="p-2 rounded">
- +
+ +
+
+
+ + +
+
+ + +
+
+ + +
+

By using this embed, you agree to our Terms of Use

@@ -650,10 +672,36 @@ export default { showCaption: true, ctxEmbedPayload: false, copiedEmbed: false, + ctxEmbedShowCaption: true, + ctxEmbedShowLikes: false, + ctxEmbedCompactMode: false, layout: this.profileLayout } }, - + watch: { + ctxEmbedShowCaption: function (n,o) { + if(n == true) { + this.ctxEmbedCompactMode = false; + } + let mode = this.ctxEmbedCompactMode ? 'compact' : 'full'; + this.ctxEmbedPayload = window.App.util.embed.post(this.status.url, this.ctxEmbedShowCaption, this.ctxEmbedShowLikes, mode); + }, + ctxEmbedShowLikes: function (n,o) { + if(n == true) { + this.ctxEmbedCompactMode = false; + } + let mode = this.ctxEmbedCompactMode ? 'compact' : 'full'; + this.ctxEmbedPayload = window.App.util.embed.post(this.status.url, this.ctxEmbedShowCaption, this.ctxEmbedShowLikes, mode); + }, + ctxEmbedCompactMode: function (n,o) { + if(n == true) { + this.ctxEmbedShowCaption = false; + this.ctxEmbedShowLikes = false; + } + let mode = this.ctxEmbedCompactMode ? 'compact' : 'full'; + this.ctxEmbedPayload = window.App.util.embed.post(this.status.url, this.ctxEmbedShowCaption, this.ctxEmbedShowLikes, mode); + } + }, beforeMount() { let u = new URLSearchParams(window.location.search); let forceMetro = localStorage.getItem('pf_metro_ui.exp.forceMetro') == 'true'; @@ -1195,7 +1243,8 @@ export default { }, showEmbedPostModal() { - this.ctxEmbedPayload = window.App.util.embed.post(this.status.url) + let mode = this.ctxEmbedCompactMode ? 'compact' : 'full'; + this.ctxEmbedPayload = window.App.util.embed.post(this.status.url, this.ctxEmbedShowCaption, this.ctxEmbedShowLikes, mode); this.$refs.embedModal.show(); },