@openeventkit/event-site 2.0.11 → 2.0.12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -199,7 +199,7 @@ const AccessTracker = ({ user, isLoggedUser, summitPhase }) => {
|
|
|
199
199
|
return user.isAuthorized;
|
|
200
200
|
};
|
|
201
201
|
|
|
202
|
-
// if
|
|
202
|
+
// if summitPhase wasn't initialized yet (eg: due to a delay in the reducer),
|
|
203
203
|
// this render shouldn't continue
|
|
204
204
|
if (summitPhase === null) return null;
|
|
205
205
|
|
|
@@ -50,7 +50,8 @@ const AuthComponent = ({
|
|
|
50
50
|
|
|
51
51
|
useEffect(() => {
|
|
52
52
|
const fragmentParser = new FragmentParser();
|
|
53
|
-
|
|
53
|
+
// to show the login dialog check if we are already logged or not
|
|
54
|
+
setIsActive(fragmentParser.getParam('login') && !isLoggedUser);
|
|
54
55
|
const paramInitialEmailValue = fragmentParser.getParam('email');
|
|
55
56
|
if (paramInitialEmailValue)
|
|
56
57
|
setInitialEmailValue(paramInitialEmailValue);
|
|
@@ -104,7 +105,6 @@ const AuthComponent = ({
|
|
|
104
105
|
};
|
|
105
106
|
|
|
106
107
|
const loginPasswordless = (code, email) => {
|
|
107
|
-
|
|
108
108
|
const params = {
|
|
109
109
|
connection: "email",
|
|
110
110
|
otp: code,
|
|
@@ -141,7 +141,12 @@ const AuthComponent = ({
|
|
|
141
141
|
const passwordlessLoginProps = {
|
|
142
142
|
email: userEmail,
|
|
143
143
|
codeLength: otpLength,
|
|
144
|
-
passwordlessLogin: (code) => loginPasswordless(code, userEmail).then(() =>
|
|
144
|
+
passwordlessLogin: (code) => loginPasswordless(code, userEmail).then(() => {
|
|
145
|
+
// close popup and then navigate bc its its the same origin page
|
|
146
|
+
// it would not reload and closed the popup automatically
|
|
147
|
+
handleClosePopup();
|
|
148
|
+
navigate(getBackURL(false))
|
|
149
|
+
}).catch((e) => console.log(e)),
|
|
145
150
|
codeError: otpError,
|
|
146
151
|
goToLogin: () => setOtpLogin(false),
|
|
147
152
|
getLoginCode: (email) => sendCode(email),
|
|
@@ -11,7 +11,7 @@ import moment from "moment-timezone";
|
|
|
11
11
|
*
|
|
12
12
|
* @param children
|
|
13
13
|
* @param isAuthorized
|
|
14
|
-
* @param
|
|
14
|
+
* @param summitPhase
|
|
15
15
|
* @param requireExtraQuestions
|
|
16
16
|
* @param hasTicket
|
|
17
17
|
* @param userProfile
|
|
@@ -22,7 +22,7 @@ import moment from "moment-timezone";
|
|
|
22
22
|
const ShowOpenRoute = ({
|
|
23
23
|
children,
|
|
24
24
|
isAuthorized,
|
|
25
|
-
|
|
25
|
+
summitPhase,
|
|
26
26
|
requireExtraQuestions,
|
|
27
27
|
hasTicket,
|
|
28
28
|
userProfile,
|
|
@@ -31,21 +31,21 @@ const ShowOpenRoute = ({
|
|
|
31
31
|
|
|
32
32
|
// if we are at show time, and we have an attendee, perform virtual check-in
|
|
33
33
|
useEffect(() => {
|
|
34
|
-
if(hasTicket &&
|
|
34
|
+
if(hasTicket && summitPhase === PHASES.DURING){
|
|
35
35
|
// verify if we have an attendee , and if so do the virtual check in
|
|
36
36
|
let attendee = userProfile?.summit_tickets[0]?.owner || null;
|
|
37
37
|
if(attendee)
|
|
38
38
|
doVirtualCheckIn(attendee);
|
|
39
39
|
}
|
|
40
|
-
},[
|
|
40
|
+
},[summitPhase, hasTicket, userProfile, doVirtualCheckIn]);
|
|
41
41
|
|
|
42
42
|
const userCanByPassAuthz = () => {
|
|
43
43
|
return isAuthorized;
|
|
44
44
|
};
|
|
45
45
|
|
|
46
|
-
// if
|
|
46
|
+
// if summitPhase wasn't initialized yet (eg: due to a delay in the reducer),
|
|
47
47
|
// this render shouldn't continue
|
|
48
|
-
if (
|
|
48
|
+
if (summitPhase === null) return null;
|
|
49
49
|
|
|
50
50
|
// if we are providing the now fragment param then let the clock
|
|
51
51
|
// component set it, so we need to bypass this next check
|
|
@@ -60,7 +60,7 @@ const ShowOpenRoute = ({
|
|
|
60
60
|
}
|
|
61
61
|
|
|
62
62
|
// if summit didnt started yet ...
|
|
63
|
-
if (!shouldBypassCheck && !userCanByPassAuthz() &&
|
|
63
|
+
if (!shouldBypassCheck && !userCanByPassAuthz() && summitPhase === PHASES.BEFORE) {
|
|
64
64
|
return <HeroComponent title="You are now logged in. Additional event info is now available on the website." redirectTo="/" />;
|
|
65
65
|
}
|
|
66
66
|
|