summit-registration-lite 3.0.28 → 4.0.0
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.
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
.passwordlessWrapper___BRQ_s{height:400px;display:flex;justify-content:center;align-items:center;flex-direction:column}.passwordlessWrapper___BRQ_s .innerWrapper___nRLDi{text-align:center;font-weight:bold;height:100%;width:300px;display:flex;flex-direction:column;justify-content:center}.passwordlessWrapper___BRQ_s .innerWrapper___nRLDi .logo___qNVrv{width:175px;align-self:center}.passwordlessWrapper___BRQ_s .innerWrapper___nRLDi .digits___Vu5iy{margin-top:15px;display:inline-block}.passwordlessWrapper___BRQ_s .innerWrapper___nRLDi .codeInput___LnTZe{margin-top:20px;display:flex;justify-content:center}.passwordlessWrapper___BRQ_s .innerWrapper___nRLDi .codeInput___LnTZe input{height:56px;width:56px;font-size:42px;background-color:var(--color_primary50);border:1px solid var(--color_primary);border-radius:5px;padding:5px;display:inline-flex;text-transform:uppercase;text-align:center;margin:0 5px}.passwordlessWrapper___BRQ_s .innerWrapper___nRLDi .error___wZflZ{margin-top:10px;color:#e5424d;font-size:14px}.passwordlessWrapper___BRQ_s .innerWrapper___nRLDi .verify___IBgMl{margin-top:20px}.passwordlessWrapper___BRQ_s .innerWrapper___nRLDi .verify___IBgMl .button___nBhtQ{padding:10px 30px;font-weight:normal;justify-content:center;margin:5px 0;border-radius:5px;cursor:pointer;background-color:var(--color_secondary_contrast);color:#FFFFFF;width:100%;font-size:1em}.passwordlessWrapper___BRQ_s .innerWrapper___nRLDi .verify___IBgMl .link___f6fDT{color:var(--color_primary);text-decoration:underline;cursor:pointer}.passwordlessWrapper___BRQ_s .resend___Nma1U{margin:auto 0 0 0;font-weight:normal;font-size:14px}.passwordlessWrapper___BRQ_s .resend___Nma1U span{color:var(--color_primary);text-decoration:underline;cursor:pointer}
|
|
2
|
+
|
|
@@ -0,0 +1,240 @@
|
|
|
1
|
+
(function webpackUniversalModuleDefinition(root, factory) {
|
|
2
|
+
if(typeof exports === 'object' && typeof module === 'object')
|
|
3
|
+
module.exports = factory();
|
|
4
|
+
else if(typeof define === 'function' && define.amd)
|
|
5
|
+
define("summit-registration-lite", [], factory);
|
|
6
|
+
else if(typeof exports === 'object')
|
|
7
|
+
exports["summit-registration-lite"] = factory();
|
|
8
|
+
else
|
|
9
|
+
root["summit-registration-lite"] = factory();
|
|
10
|
+
})(this, function() {
|
|
11
|
+
return /******/ (() => { // webpackBootstrap
|
|
12
|
+
/******/ var __webpack_modules__ = ({
|
|
13
|
+
|
|
14
|
+
/***/ 802:
|
|
15
|
+
/***/ ((module) => {
|
|
16
|
+
|
|
17
|
+
module.exports = "data:image/svg+xml,%3c!-- Generator: Adobe Illustrator 25.4.1, SVG Export Plug-In . SVG Version: 6.00 Build 0) --%3e %3csvg version='1.1' id='Layer_1' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' x='0px' y='0px' viewBox='0 0 812.24 471.64' style='enable-background:new 0 0 812.24 471.64;' xml:space='preserve'%3e %3cstyle type='text/css'%3e .st0%7bfill:%230C64C8;%7d %3c/style%3e %3cg%3e %3cpath d='M170.89,146.78l-64.77,178.08h535.23l64.77-178.08L170.89,146.78L170.89,146.78z M384.48,309.44H341.7l-25.6-80.85 l-29.41,80.85h-42.6l41.94-115.3h-65.52l-9.29,25.54h56.62l-10.8,29.7h-56.62l-21.84,60.06h-45.63l53.39-146.78h153.49l25.72,81.24 l29.56-81.24h42.75L384.48,309.44z'/%3e %3cg%3e %3cpath class='st0' d='M588.49,162.71v50.86c-4-4.27-8.59-7.47-13.76-9.61s-10.92-3.21-17.26-3.21c-13.01,0-23.73,4.67-32.17,14.02 c-8.44,9.34-12.66,22.83-12.66,40.45c0,15.75,3.82,29.13,11.46,40.15c7.64,11.01,18.69,16.52,33.17,16.52 c7.2,0,13.74-1.54,19.61-4.6c4.4-2.34,9.27-6.84,14.61-13.52v15.72h38.12V162.71H588.49z M583.59,275.94 c-3.47,4.07-7.8,6.11-13.01,6.11c-4.87,0-8.96-2.02-12.26-6.06s-4.95-10.4-4.95-19.07c0-9.28,1.6-15.88,4.8-19.82 s7.17-5.91,11.91-5.91c5.4,0,9.87,2.05,13.41,6.16c3.53,4.1,5.3,10.33,5.3,18.67C588.79,265.23,587.05,271.87,583.59,275.94z'/%3e %3cpath class='st0' d='M473.92,207.72c-14.37,0-26.03,7.27-26.03,16.25v2.96v45.48h9.09l3.47,37.09h26.95l3.47-37.09h9.09v-45.48 v-2.96C499.95,214.99,488.29,207.72,473.92,207.72z'/%3e %3cellipse transform='matrix(2.075247e-03 -1 1 2.075247e-03 290.6104 655.8611)' class='st0' cx='473.92' cy='182.32' rx='19.87' ry='19.86'/%3e %3c/g%3e %3c/g%3e %3c/svg%3e"
|
|
18
|
+
|
|
19
|
+
/***/ }),
|
|
20
|
+
|
|
21
|
+
/***/ 580:
|
|
22
|
+
/***/ ((module) => {
|
|
23
|
+
|
|
24
|
+
"use strict";
|
|
25
|
+
module.exports = require("prop-types");
|
|
26
|
+
|
|
27
|
+
/***/ }),
|
|
28
|
+
|
|
29
|
+
/***/ 689:
|
|
30
|
+
/***/ ((module) => {
|
|
31
|
+
|
|
32
|
+
"use strict";
|
|
33
|
+
module.exports = require("react");
|
|
34
|
+
|
|
35
|
+
/***/ })
|
|
36
|
+
|
|
37
|
+
/******/ });
|
|
38
|
+
/************************************************************************/
|
|
39
|
+
/******/ // The module cache
|
|
40
|
+
/******/ var __webpack_module_cache__ = {};
|
|
41
|
+
/******/
|
|
42
|
+
/******/ // The require function
|
|
43
|
+
/******/ function __webpack_require__(moduleId) {
|
|
44
|
+
/******/ // Check if module is in cache
|
|
45
|
+
/******/ var cachedModule = __webpack_module_cache__[moduleId];
|
|
46
|
+
/******/ if (cachedModule !== undefined) {
|
|
47
|
+
/******/ return cachedModule.exports;
|
|
48
|
+
/******/ }
|
|
49
|
+
/******/ // Create a new module (and put it into the cache)
|
|
50
|
+
/******/ var module = __webpack_module_cache__[moduleId] = {
|
|
51
|
+
/******/ // no module.id needed
|
|
52
|
+
/******/ // no module.loaded needed
|
|
53
|
+
/******/ exports: {}
|
|
54
|
+
/******/ };
|
|
55
|
+
/******/
|
|
56
|
+
/******/ // Execute the module function
|
|
57
|
+
/******/ __webpack_modules__[moduleId](module, module.exports, __webpack_require__);
|
|
58
|
+
/******/
|
|
59
|
+
/******/ // Return the exports of the module
|
|
60
|
+
/******/ return module.exports;
|
|
61
|
+
/******/ }
|
|
62
|
+
/******/
|
|
63
|
+
/************************************************************************/
|
|
64
|
+
/******/ /* webpack/runtime/compat get default export */
|
|
65
|
+
/******/ (() => {
|
|
66
|
+
/******/ // getDefaultExport function for compatibility with non-harmony modules
|
|
67
|
+
/******/ __webpack_require__.n = (module) => {
|
|
68
|
+
/******/ var getter = module && module.__esModule ?
|
|
69
|
+
/******/ () => (module['default']) :
|
|
70
|
+
/******/ () => (module);
|
|
71
|
+
/******/ __webpack_require__.d(getter, { a: getter });
|
|
72
|
+
/******/ return getter;
|
|
73
|
+
/******/ };
|
|
74
|
+
/******/ })();
|
|
75
|
+
/******/
|
|
76
|
+
/******/ /* webpack/runtime/define property getters */
|
|
77
|
+
/******/ (() => {
|
|
78
|
+
/******/ // define getter functions for harmony exports
|
|
79
|
+
/******/ __webpack_require__.d = (exports, definition) => {
|
|
80
|
+
/******/ for(var key in definition) {
|
|
81
|
+
/******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {
|
|
82
|
+
/******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });
|
|
83
|
+
/******/ }
|
|
84
|
+
/******/ }
|
|
85
|
+
/******/ };
|
|
86
|
+
/******/ })();
|
|
87
|
+
/******/
|
|
88
|
+
/******/ /* webpack/runtime/hasOwnProperty shorthand */
|
|
89
|
+
/******/ (() => {
|
|
90
|
+
/******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))
|
|
91
|
+
/******/ })();
|
|
92
|
+
/******/
|
|
93
|
+
/******/ /* webpack/runtime/make namespace object */
|
|
94
|
+
/******/ (() => {
|
|
95
|
+
/******/ // define __esModule on exports
|
|
96
|
+
/******/ __webpack_require__.r = (exports) => {
|
|
97
|
+
/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
|
|
98
|
+
/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
99
|
+
/******/ }
|
|
100
|
+
/******/ Object.defineProperty(exports, '__esModule', { value: true });
|
|
101
|
+
/******/ };
|
|
102
|
+
/******/ })();
|
|
103
|
+
/******/
|
|
104
|
+
/************************************************************************/
|
|
105
|
+
var __webpack_exports__ = {};
|
|
106
|
+
// This entry need to be wrapped in an IIFE because it need to be in strict mode.
|
|
107
|
+
(() => {
|
|
108
|
+
"use strict";
|
|
109
|
+
// ESM COMPAT FLAG
|
|
110
|
+
__webpack_require__.r(__webpack_exports__);
|
|
111
|
+
|
|
112
|
+
// EXPORTS
|
|
113
|
+
__webpack_require__.d(__webpack_exports__, {
|
|
114
|
+
"default": () => (/* binding */ login_passwordless)
|
|
115
|
+
});
|
|
116
|
+
|
|
117
|
+
// EXTERNAL MODULE: external "react"
|
|
118
|
+
var external_react_ = __webpack_require__(689);
|
|
119
|
+
var external_react_default = /*#__PURE__*/__webpack_require__.n(external_react_);
|
|
120
|
+
// EXTERNAL MODULE: external "prop-types"
|
|
121
|
+
var external_prop_types_ = __webpack_require__(580);
|
|
122
|
+
var external_prop_types_default = /*#__PURE__*/__webpack_require__.n(external_prop_types_);
|
|
123
|
+
;// CONCATENATED MODULE: external "react-otp-input"
|
|
124
|
+
const external_react_otp_input_namespaceObject = require("react-otp-input");
|
|
125
|
+
var external_react_otp_input_default = /*#__PURE__*/__webpack_require__.n(external_react_otp_input_namespaceObject);
|
|
126
|
+
;// CONCATENATED MODULE: ./src/components/login-passwordless/index.module.scss
|
|
127
|
+
// extracted by mini-css-extract-plugin
|
|
128
|
+
/* harmony default export */ const index_module = ({"passwordlessWrapper":"passwordlessWrapper___BRQ_s","innerWrapper":"innerWrapper___nRLDi","logo":"logo___qNVrv","digits":"digits___Vu5iy","codeInput":"codeInput___LnTZe","error":"error___wZflZ","verify":"verify___IBgMl","button":"button___nBhtQ","link":"link___f6fDT","resend":"resend___Nma1U"});
|
|
129
|
+
// EXTERNAL MODULE: ./src/assets/FNid_WHT_logo_rgb.svg
|
|
130
|
+
var FNid_WHT_logo_rgb = __webpack_require__(802);
|
|
131
|
+
var FNid_WHT_logo_rgb_default = /*#__PURE__*/__webpack_require__.n(FNid_WHT_logo_rgb);
|
|
132
|
+
;// CONCATENATED MODULE: ./src/components/login-passwordless/index.js
|
|
133
|
+
/**
|
|
134
|
+
* Copyright 2020 OpenStack Foundation
|
|
135
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
136
|
+
* you may not use this file except in compliance with the License.
|
|
137
|
+
* You may obtain a copy of the License at
|
|
138
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
139
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
140
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
141
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
142
|
+
* See the License for the specific language governing permissions and
|
|
143
|
+
* limitations under the License.
|
|
144
|
+
**/
|
|
145
|
+
|
|
146
|
+
|
|
147
|
+
|
|
148
|
+
|
|
149
|
+
|
|
150
|
+
|
|
151
|
+
const PasswordlessLoginComponent = ({
|
|
152
|
+
email,
|
|
153
|
+
codeLength,
|
|
154
|
+
passwordlessLogin,
|
|
155
|
+
loginWithCode,
|
|
156
|
+
codeError,
|
|
157
|
+
goToLogin,
|
|
158
|
+
getLoginCode,
|
|
159
|
+
getPasswordlessCode
|
|
160
|
+
}) => {
|
|
161
|
+
const [otpCode, setOtpCode] = (0,external_react_.useState)('');
|
|
162
|
+
const [otpError, setOtpError] = (0,external_react_.useState)(false);
|
|
163
|
+
|
|
164
|
+
const tryPasswordlessLogin = code => {
|
|
165
|
+
if (code.length === codeLength) {
|
|
166
|
+
setOtpError(false);
|
|
167
|
+
passwordlessLogin(otpCode, loginWithCode);
|
|
168
|
+
} else {
|
|
169
|
+
setOtpError(true);
|
|
170
|
+
}
|
|
171
|
+
};
|
|
172
|
+
|
|
173
|
+
const resendCode = () => {
|
|
174
|
+
getLoginCode(email, getPasswordlessCode);
|
|
175
|
+
};
|
|
176
|
+
|
|
177
|
+
return /*#__PURE__*/external_react_default().createElement("div", {
|
|
178
|
+
className: `${index_module.passwordlessWrapper} step-wrapper`
|
|
179
|
+
}, /*#__PURE__*/external_react_default().createElement((external_react_default()).Fragment, null, /*#__PURE__*/external_react_default().createElement("div", {
|
|
180
|
+
className: `${index_module.innerWrapper}`
|
|
181
|
+
}, /*#__PURE__*/external_react_default().createElement("img", {
|
|
182
|
+
src: (FNid_WHT_logo_rgb_default()),
|
|
183
|
+
alt: "FNid",
|
|
184
|
+
className: index_module.logo
|
|
185
|
+
}), /*#__PURE__*/external_react_default().createElement("span", null, "We sent your single-use login code to ", /*#__PURE__*/external_react_default().createElement("br", null), /*#__PURE__*/external_react_default().createElement("span", {
|
|
186
|
+
"data-testid": "email"
|
|
187
|
+
}, email), /*#__PURE__*/external_react_default().createElement("br", null), /*#__PURE__*/external_react_default().createElement("span", {
|
|
188
|
+
className: index_module.digits,
|
|
189
|
+
"data-testid": "code-digits"
|
|
190
|
+
}, "Add the ", codeLength, " digit code below")), /*#__PURE__*/external_react_default().createElement("div", {
|
|
191
|
+
className: index_module.codeInput
|
|
192
|
+
}, /*#__PURE__*/external_react_default().createElement((external_react_otp_input_default()), {
|
|
193
|
+
value: otpCode,
|
|
194
|
+
onChange: code => setOtpCode(code),
|
|
195
|
+
numInputs: codeLength,
|
|
196
|
+
shouldAutoFocus: true,
|
|
197
|
+
hasErrored: otpError || codeError,
|
|
198
|
+
errorStyle: {
|
|
199
|
+
border: '1px solid #e5424d'
|
|
200
|
+
},
|
|
201
|
+
"data-testid": "otp-input"
|
|
202
|
+
})), codeError && /*#__PURE__*/external_react_default().createElement("span", {
|
|
203
|
+
className: index_module.error,
|
|
204
|
+
"data-testid": "error"
|
|
205
|
+
}, "The code you entered it's incorrect. ", /*#__PURE__*/external_react_default().createElement("br", null), " Please try again."), /*#__PURE__*/external_react_default().createElement("div", {
|
|
206
|
+
className: index_module.verify
|
|
207
|
+
}, /*#__PURE__*/external_react_default().createElement("div", {
|
|
208
|
+
className: `${index_module.button} button`,
|
|
209
|
+
onClick: () => tryPasswordlessLogin(otpCode),
|
|
210
|
+
"data-testid": "verify"
|
|
211
|
+
}, "Verify Email"), /*#__PURE__*/external_react_default().createElement("b", null, "or go back and ", /*#__PURE__*/external_react_default().createElement("span", {
|
|
212
|
+
className: index_module.link,
|
|
213
|
+
onClick: () => goToLogin(),
|
|
214
|
+
"data-testid": "go-back"
|
|
215
|
+
}, "try another way")))), /*#__PURE__*/external_react_default().createElement("div", {
|
|
216
|
+
className: index_module.resend
|
|
217
|
+
}, "Didn\u2019t receive it? Check your spam/junk folder, or ", /*#__PURE__*/external_react_default().createElement("span", {
|
|
218
|
+
className: index_module.link,
|
|
219
|
+
onClick: () => resendCode(),
|
|
220
|
+
"data-testid": "resend"
|
|
221
|
+
}, "resend email"), " now.")));
|
|
222
|
+
};
|
|
223
|
+
|
|
224
|
+
PasswordlessLoginComponent.propTypes = {
|
|
225
|
+
email: (external_prop_types_default()).string.isRequired,
|
|
226
|
+
codeLength: (external_prop_types_default()).number.isRequired,
|
|
227
|
+
passwordlessLogin: (external_prop_types_default()).func.isRequired,
|
|
228
|
+
loginWithCode: (external_prop_types_default()).func,
|
|
229
|
+
codeError: (external_prop_types_default()).bool,
|
|
230
|
+
goToLogin: (external_prop_types_default()).func.isRequired,
|
|
231
|
+
getLoginCode: (external_prop_types_default()).func.isRequired,
|
|
232
|
+
getPasswordlessCode: (external_prop_types_default()).func
|
|
233
|
+
};
|
|
234
|
+
/* harmony default export */ const login_passwordless = (PasswordlessLoginComponent);
|
|
235
|
+
})();
|
|
236
|
+
|
|
237
|
+
/******/ return __webpack_exports__;
|
|
238
|
+
/******/ })()
|
|
239
|
+
;
|
|
240
|
+
});
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
.loginWrapper___sxUEn{display:flex;justify-content:center;font-weight:bold;text-align:center;padding:20px 0 30px}.innerWrapper___GQRkq{display:flex;flex-direction:column;justify-content:center;width:300px}.innerWrapper___GQRkq span{margin:10px 0}.button___QMZPu{padding:10px 30px;background-color:red;color:white;font-weight:normal;display:inline-flex;justify-content:center;margin:5px 0;border-radius:5px;cursor:pointer;background-position:28px center;background-repeat:no-repeat;background-size:16px;line-height:1.4;box-shadow:0px 3px 1px -2px rgba(0,0,0,0.2),0px 2px 2px 0px rgba(0,0,0,0.14),0px 1px 5px 0px rgba(0,0,0,0.12)}.button___QMZPu:hover{box-shadow:0px 2px 4px -1px rgba(0,0,0,0.2),0px 4px 5px 0px rgba(0,0,0,0.14),0px 1px 10px 0px rgba(0,0,0,0.12)}.loginCode___dDBup{margin-bottom:10px;font-size:16px}.loginCode___dDBup>div{margin-top:10px}.loginCode___dDBup span{display:inline-block;font-weight:normal;font-size:14px;color:#e5424d}.input___QR9sA{display:flex;height:40px;margin-top:5px}.input___QR9sA input{border:1px solid var(--color_primary);border-radius:5px;padding:5px;width:100%}.input___QR9sA input::placeholder{color:var(--color_text_input_hints)}.input___QR9sA button{margin-left:5px;background-color:var(--color_secondary_contrast);padding:0px 15px;border:1px solid var(--color_secondary_contrast);color:#fff;box-shadow:none;text-align:center;white-space:nowrap;font-weight:bold;border-radius:5px;cursor:pointer;display:flex;align-items:center;justify-content:center}
|
|
2
|
+
|
|
@@ -0,0 +1,243 @@
|
|
|
1
|
+
(function webpackUniversalModuleDefinition(root, factory) {
|
|
2
|
+
if(typeof exports === 'object' && typeof module === 'object')
|
|
3
|
+
module.exports = factory();
|
|
4
|
+
else if(typeof define === 'function' && define.amd)
|
|
5
|
+
define("summit-registration-lite", [], factory);
|
|
6
|
+
else if(typeof exports === 'object')
|
|
7
|
+
exports["summit-registration-lite"] = factory();
|
|
8
|
+
else
|
|
9
|
+
root["summit-registration-lite"] = factory();
|
|
10
|
+
})(this, function() {
|
|
11
|
+
return /******/ (() => { // webpackBootstrap
|
|
12
|
+
/******/ "use strict";
|
|
13
|
+
/******/ var __webpack_modules__ = ({
|
|
14
|
+
|
|
15
|
+
/***/ 580:
|
|
16
|
+
/***/ ((module) => {
|
|
17
|
+
|
|
18
|
+
module.exports = require("prop-types");
|
|
19
|
+
|
|
20
|
+
/***/ }),
|
|
21
|
+
|
|
22
|
+
/***/ 689:
|
|
23
|
+
/***/ ((module) => {
|
|
24
|
+
|
|
25
|
+
module.exports = require("react");
|
|
26
|
+
|
|
27
|
+
/***/ })
|
|
28
|
+
|
|
29
|
+
/******/ });
|
|
30
|
+
/************************************************************************/
|
|
31
|
+
/******/ // The module cache
|
|
32
|
+
/******/ var __webpack_module_cache__ = {};
|
|
33
|
+
/******/
|
|
34
|
+
/******/ // The require function
|
|
35
|
+
/******/ function __webpack_require__(moduleId) {
|
|
36
|
+
/******/ // Check if module is in cache
|
|
37
|
+
/******/ var cachedModule = __webpack_module_cache__[moduleId];
|
|
38
|
+
/******/ if (cachedModule !== undefined) {
|
|
39
|
+
/******/ return cachedModule.exports;
|
|
40
|
+
/******/ }
|
|
41
|
+
/******/ // Create a new module (and put it into the cache)
|
|
42
|
+
/******/ var module = __webpack_module_cache__[moduleId] = {
|
|
43
|
+
/******/ // no module.id needed
|
|
44
|
+
/******/ // no module.loaded needed
|
|
45
|
+
/******/ exports: {}
|
|
46
|
+
/******/ };
|
|
47
|
+
/******/
|
|
48
|
+
/******/ // Execute the module function
|
|
49
|
+
/******/ __webpack_modules__[moduleId](module, module.exports, __webpack_require__);
|
|
50
|
+
/******/
|
|
51
|
+
/******/ // Return the exports of the module
|
|
52
|
+
/******/ return module.exports;
|
|
53
|
+
/******/ }
|
|
54
|
+
/******/
|
|
55
|
+
/************************************************************************/
|
|
56
|
+
/******/ /* webpack/runtime/compat get default export */
|
|
57
|
+
/******/ (() => {
|
|
58
|
+
/******/ // getDefaultExport function for compatibility with non-harmony modules
|
|
59
|
+
/******/ __webpack_require__.n = (module) => {
|
|
60
|
+
/******/ var getter = module && module.__esModule ?
|
|
61
|
+
/******/ () => (module['default']) :
|
|
62
|
+
/******/ () => (module);
|
|
63
|
+
/******/ __webpack_require__.d(getter, { a: getter });
|
|
64
|
+
/******/ return getter;
|
|
65
|
+
/******/ };
|
|
66
|
+
/******/ })();
|
|
67
|
+
/******/
|
|
68
|
+
/******/ /* webpack/runtime/define property getters */
|
|
69
|
+
/******/ (() => {
|
|
70
|
+
/******/ // define getter functions for harmony exports
|
|
71
|
+
/******/ __webpack_require__.d = (exports, definition) => {
|
|
72
|
+
/******/ for(var key in definition) {
|
|
73
|
+
/******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {
|
|
74
|
+
/******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });
|
|
75
|
+
/******/ }
|
|
76
|
+
/******/ }
|
|
77
|
+
/******/ };
|
|
78
|
+
/******/ })();
|
|
79
|
+
/******/
|
|
80
|
+
/******/ /* webpack/runtime/hasOwnProperty shorthand */
|
|
81
|
+
/******/ (() => {
|
|
82
|
+
/******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))
|
|
83
|
+
/******/ })();
|
|
84
|
+
/******/
|
|
85
|
+
/******/ /* webpack/runtime/make namespace object */
|
|
86
|
+
/******/ (() => {
|
|
87
|
+
/******/ // define __esModule on exports
|
|
88
|
+
/******/ __webpack_require__.r = (exports) => {
|
|
89
|
+
/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
|
|
90
|
+
/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
91
|
+
/******/ }
|
|
92
|
+
/******/ Object.defineProperty(exports, '__esModule', { value: true });
|
|
93
|
+
/******/ };
|
|
94
|
+
/******/ })();
|
|
95
|
+
/******/
|
|
96
|
+
/************************************************************************/
|
|
97
|
+
var __webpack_exports__ = {};
|
|
98
|
+
// This entry need to be wrapped in an IIFE because it need to be isolated against other modules in the chunk.
|
|
99
|
+
(() => {
|
|
100
|
+
// ESM COMPAT FLAG
|
|
101
|
+
__webpack_require__.r(__webpack_exports__);
|
|
102
|
+
|
|
103
|
+
// EXPORTS
|
|
104
|
+
__webpack_require__.d(__webpack_exports__, {
|
|
105
|
+
"default": () => (/* binding */ login)
|
|
106
|
+
});
|
|
107
|
+
|
|
108
|
+
// EXTERNAL MODULE: external "react"
|
|
109
|
+
var external_react_ = __webpack_require__(689);
|
|
110
|
+
var external_react_default = /*#__PURE__*/__webpack_require__.n(external_react_);
|
|
111
|
+
// EXTERNAL MODULE: external "prop-types"
|
|
112
|
+
var external_prop_types_ = __webpack_require__(580);
|
|
113
|
+
var external_prop_types_default = /*#__PURE__*/__webpack_require__.n(external_prop_types_);
|
|
114
|
+
;// CONCATENATED MODULE: ./src/components/login/index.module.scss
|
|
115
|
+
// extracted by mini-css-extract-plugin
|
|
116
|
+
/* harmony default export */ const index_module = ({"loginWrapper":"loginWrapper___sxUEn","innerWrapper":"innerWrapper___GQRkq","button":"button___QMZPu","loginCode":"loginCode___dDBup","input":"input___QR9sA"});
|
|
117
|
+
;// CONCATENATED MODULE: ./src/components/login/index.js
|
|
118
|
+
/**
|
|
119
|
+
* Copyright 2020 OpenStack Foundation
|
|
120
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
121
|
+
* you may not use this file except in compliance with the License.
|
|
122
|
+
* You may obtain a copy of the License at
|
|
123
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
124
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
125
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
126
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
127
|
+
* See the License for the specific language governing permissions and
|
|
128
|
+
* limitations under the License.
|
|
129
|
+
**/
|
|
130
|
+
|
|
131
|
+
|
|
132
|
+
|
|
133
|
+
|
|
134
|
+
const LoginComponent = ({
|
|
135
|
+
loginOptions,
|
|
136
|
+
login,
|
|
137
|
+
allowsNativeAuth,
|
|
138
|
+
allowsOtpAuthlogin,
|
|
139
|
+
getLoginCode,
|
|
140
|
+
getPasswordlessCode,
|
|
141
|
+
initialEmailValue
|
|
142
|
+
}) => {
|
|
143
|
+
const [email, setEmail] = (0,external_react_.useState)(initialEmailValue);
|
|
144
|
+
const [emailError, setEmailError] = (0,external_react_.useState)();
|
|
145
|
+
|
|
146
|
+
const isValidEmail = email => {
|
|
147
|
+
const re = /^(([^<>()[\]\\.,;:\s@"]+(\.[^<>()[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/;
|
|
148
|
+
return re.test(String(email).toLowerCase());
|
|
149
|
+
};
|
|
150
|
+
|
|
151
|
+
const loginCode = () => {
|
|
152
|
+
let isValid = isValidEmail(email);
|
|
153
|
+
setEmailError(!isValid);
|
|
154
|
+
|
|
155
|
+
if (isValid) {
|
|
156
|
+
getLoginCode(email, getPasswordlessCode);
|
|
157
|
+
}
|
|
158
|
+
};
|
|
159
|
+
|
|
160
|
+
return /*#__PURE__*/external_react_default().createElement("div", {
|
|
161
|
+
className: `${index_module.loginWrapper} step-wrapper`
|
|
162
|
+
}, /*#__PURE__*/external_react_default().createElement((external_react_default()).Fragment, null, /*#__PURE__*/external_react_default().createElement("div", {
|
|
163
|
+
className: `${index_module.innerWrapper}`
|
|
164
|
+
}, /*#__PURE__*/external_react_default().createElement("div", {
|
|
165
|
+
className: index_module.loginCode
|
|
166
|
+
}, "Enter your email to begin registration:", /*#__PURE__*/external_react_default().createElement("div", {
|
|
167
|
+
className: index_module.input
|
|
168
|
+
}, /*#__PURE__*/external_react_default().createElement("input", {
|
|
169
|
+
placeholder: "youremail@example.com",
|
|
170
|
+
value: email,
|
|
171
|
+
onChange: e => setEmail(e.target.value),
|
|
172
|
+
onKeyPress: ev => ev.key === 'Enter' ? loginCode() : null,
|
|
173
|
+
"data-testid": "email-input"
|
|
174
|
+
}), /*#__PURE__*/external_react_default().createElement("button", {
|
|
175
|
+
onClick: () => loginCode(),
|
|
176
|
+
"data-testid": "email-button"
|
|
177
|
+
}, ">"), /*#__PURE__*/external_react_default().createElement("br", null)), emailError && /*#__PURE__*/external_react_default().createElement("span", {
|
|
178
|
+
"data-testid": "email-error"
|
|
179
|
+
}, "Please enter a valid email address")), /*#__PURE__*/external_react_default().createElement("span", null, "Or you may login with one of the following:"), loginOptions.map((o, index) => {
|
|
180
|
+
return o.provider_param ? /*#__PURE__*/external_react_default().createElement("div", {
|
|
181
|
+
className: `${index_module.button}`,
|
|
182
|
+
key: `provider-${o.provider_param}`,
|
|
183
|
+
"data-testid": "login-button",
|
|
184
|
+
style: {
|
|
185
|
+
color: o.button_border_color ? o.button_border_color : '#ffffff',
|
|
186
|
+
border: `thin solid ${o.button_border_color ? o.button_border_color : o.button_color}`,
|
|
187
|
+
backgroundColor: o.button_color,
|
|
188
|
+
backgroundImage: o.provider_logo ? `url(${o.provider_logo})` : 'none',
|
|
189
|
+
backgroundSize: o.provider_logo_size ? o.provider_logo_size : ''
|
|
190
|
+
},
|
|
191
|
+
onClick: () => login(o.provider_param)
|
|
192
|
+
}, o.provider_label) : allowsNativeAuth ? /*#__PURE__*/external_react_default().createElement("div", {
|
|
193
|
+
className: `${index_module.button}`,
|
|
194
|
+
key: `provider-fnid`,
|
|
195
|
+
"data-testid": "login-button",
|
|
196
|
+
style: {
|
|
197
|
+
color: o.button_border_color ? o.button_border_color : '#ffffff',
|
|
198
|
+
border: `thin solid ${o.button_border_color ? o.button_border_color : o.button_color}`,
|
|
199
|
+
backgroundColor: o.button_color,
|
|
200
|
+
backgroundImage: o.provider_logo ? `url(${o.provider_logo})` : 'none',
|
|
201
|
+
backgroundSize: o.provider_logo_size ? o.provider_logo_size : ''
|
|
202
|
+
},
|
|
203
|
+
onClick: () => login(o.provider_param)
|
|
204
|
+
}, o.provider_label) : null;
|
|
205
|
+
}), allowsOtpAuthlogin && /*#__PURE__*/external_react_default().createElement("div", {
|
|
206
|
+
className: index_module.loginCode
|
|
207
|
+
}, "or get a login code emailed to you", /*#__PURE__*/external_react_default().createElement("div", {
|
|
208
|
+
className: index_module.input
|
|
209
|
+
}, /*#__PURE__*/external_react_default().createElement("input", {
|
|
210
|
+
placeholder: "youremail@example.com",
|
|
211
|
+
value: email,
|
|
212
|
+
onChange: e => setEmail(e.target.value),
|
|
213
|
+
onKeyPress: ev => ev.key === 'Enter' ? loginCode() : null,
|
|
214
|
+
"data-testid": "email-input"
|
|
215
|
+
}), /*#__PURE__*/external_react_default().createElement("button", {
|
|
216
|
+
onClick: () => loginCode(),
|
|
217
|
+
"data-testid": "email-button"
|
|
218
|
+
}, ">"), /*#__PURE__*/external_react_default().createElement("br", null)), emailError && /*#__PURE__*/external_react_default().createElement("span", {
|
|
219
|
+
"data-testid": "email-error"
|
|
220
|
+
}, "Please enter a valid email adress")))));
|
|
221
|
+
};
|
|
222
|
+
|
|
223
|
+
LoginComponent.propTypes = {
|
|
224
|
+
loginOptions: (external_prop_types_default()).array.isRequired,
|
|
225
|
+
login: (external_prop_types_default()).func.isRequired,
|
|
226
|
+
allowsNativeAuth: (external_prop_types_default()).bool,
|
|
227
|
+
allowsOtpAuthlogin: (external_prop_types_default()).bool,
|
|
228
|
+
getLoginCode: (external_prop_types_default()).func.isRequired,
|
|
229
|
+
getPasswordlessCode: (external_prop_types_default()).func,
|
|
230
|
+
initialEmailValue: (external_prop_types_default()).string
|
|
231
|
+
};
|
|
232
|
+
LoginComponent.defaultProps = {
|
|
233
|
+
allowsNativeAuth: true,
|
|
234
|
+
allowsOtpAuthlogin: false,
|
|
235
|
+
initialEmailValue: ''
|
|
236
|
+
};
|
|
237
|
+
/* harmony default export */ const login = (LoginComponent);
|
|
238
|
+
})();
|
|
239
|
+
|
|
240
|
+
/******/ return __webpack_exports__;
|
|
241
|
+
/******/ })()
|
|
242
|
+
;
|
|
243
|
+
});
|