Skip to content

Commit 78a9c97

Browse files
committed
FIX: Ensure no access skip works for guests
1 parent b05ed50 commit 78a9c97

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

assets/javascripts/discourse/components/custom-wizard-no-access.js.es6

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import CustomWizard from "../models/custom-wizard";
22
import discourseComputed from "discourse-common/utils/decorators";
33
import Component from "@ember/component";
44
import { dasherize } from "@ember/string";
5+
import getURL from "discourse-common/lib/get-url";
56

67
export default Component.extend({
78
classNameBindings: [":wizard-no-access", "reasonClass"],
@@ -18,7 +19,11 @@ export default Component.extend({
1819

1920
actions: {
2021
skip() {
21-
CustomWizard.skip(this.get("wizardId"));
22+
if (this.currentUser) {
23+
CustomWizard.skip(this.get("wizardId"));
24+
} else {
25+
window.location = getURL("/");
26+
}
2227
},
2328
},
2429
});

plugin.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# frozen_string_literal: true
22
# name: discourse-custom-wizard
33
# about: Forms for Discourse. Better onboarding, structured posting, data enrichment, automated actions and much more.
4-
# version: 1.22.7
4+
# version: 1.22.8
55
# authors: Angus McLeod, Faizaan Gagan, Robert Barrow, Keegan George
66
# url: https://github.com/paviliondev/discourse-custom-wizard
77
# contact_emails: development@pavilion.tech

0 commit comments

Comments
 (0)