@webiny/app-admin-cognito 0.0.0-ee-vpcs.549378cf03
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/LICENSE +21 -0
- package/README.md +0 -0
- package/index.d.ts +22 -0
- package/index.js +222 -0
- package/index.js.map +1 -0
- package/package.json +63 -0
- package/types.d.ts +0 -0
- package/types.js +1 -0
- package/types.js.map +1 -0
- package/views/ForgotPassword.d.ts +3 -0
- package/views/ForgotPassword.js +140 -0
- package/views/ForgotPassword.js.map +1 -0
- package/views/LoggingIn.d.ts +3 -0
- package/views/LoggingIn.js +21 -0
- package/views/LoggingIn.js.map +1 -0
- package/views/RequireNewPassword.d.ts +3 -0
- package/views/RequireNewPassword.js +99 -0
- package/views/RequireNewPassword.js.map +1 -0
- package/views/SetNewPassword.d.ts +3 -0
- package/views/SetNewPassword.js +133 -0
- package/views/SetNewPassword.js.map +1 -0
- package/views/SignIn.d.ts +3 -0
- package/views/SignIn.js +120 -0
- package/views/SignIn.js.map +1 -0
- package/views/SignedIn.d.ts +3 -0
- package/views/SignedIn.js +20 -0
- package/views/SignedIn.js.map +1 -0
- package/views/StateContainer.d.ts +3 -0
- package/views/StateContainer.js +22 -0
- package/views/StateContainer.js.map +1 -0
- package/views/StyledComponents.d.ts +12 -0
- package/views/StyledComponents.js +93 -0
- package/views/StyledComponents.js.map +1 -0
- package/views/webiny-orange-logo.svg +23 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) Webiny
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
File without changes
|
package/index.d.ts
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { AuthOptions } from "@aws-amplify/auth/lib-esm/types";
|
|
3
|
+
import ApolloClient from "apollo-client";
|
|
4
|
+
export interface AuthenticationProps {
|
|
5
|
+
children: React.ReactNode;
|
|
6
|
+
}
|
|
7
|
+
export interface AuthenticationFactoryConfig extends AuthOptions {
|
|
8
|
+
onError?(error: Error): void;
|
|
9
|
+
getIdentityData(params: {
|
|
10
|
+
client: ApolloClient<any>;
|
|
11
|
+
payload: {
|
|
12
|
+
[key: string]: any;
|
|
13
|
+
};
|
|
14
|
+
}): Promise<{
|
|
15
|
+
[key: string]: any;
|
|
16
|
+
}>;
|
|
17
|
+
}
|
|
18
|
+
interface AuthenticationFactory {
|
|
19
|
+
(params: AuthenticationFactoryConfig): React.FC<AuthenticationProps>;
|
|
20
|
+
}
|
|
21
|
+
export declare const createAuthentication: AuthenticationFactory;
|
|
22
|
+
export {};
|
package/index.js
ADDED
|
@@ -0,0 +1,222 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
4
|
+
|
|
5
|
+
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard").default;
|
|
6
|
+
|
|
7
|
+
Object.defineProperty(exports, "__esModule", {
|
|
8
|
+
value: true
|
|
9
|
+
});
|
|
10
|
+
exports.createAuthentication = void 0;
|
|
11
|
+
|
|
12
|
+
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
|
13
|
+
|
|
14
|
+
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
|
|
15
|
+
|
|
16
|
+
var _regeneratorRuntime2 = _interopRequireDefault(require("@babel/runtime/helpers/regeneratorRuntime"));
|
|
17
|
+
|
|
18
|
+
var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/objectSpread2"));
|
|
19
|
+
|
|
20
|
+
var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
|
|
21
|
+
|
|
22
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
23
|
+
|
|
24
|
+
var _auth = require("@aws-amplify/auth");
|
|
25
|
+
|
|
26
|
+
var _reactHooks = require("@apollo/react-hooks");
|
|
27
|
+
|
|
28
|
+
var _apolloLinkContext = require("apollo-link-context");
|
|
29
|
+
|
|
30
|
+
var _plugins = require("@webiny/plugins");
|
|
31
|
+
|
|
32
|
+
var _ApolloLinkPlugin = require("@webiny/app/plugins/ApolloLinkPlugin");
|
|
33
|
+
|
|
34
|
+
var _Authenticator = require("@webiny/app-cognito-authenticator/Authenticator");
|
|
35
|
+
|
|
36
|
+
var _SignIn = _interopRequireDefault(require("./views/SignIn"));
|
|
37
|
+
|
|
38
|
+
var _RequireNewPassword = _interopRequireDefault(require("./views/RequireNewPassword"));
|
|
39
|
+
|
|
40
|
+
var _ForgotPassword = _interopRequireDefault(require("./views/ForgotPassword"));
|
|
41
|
+
|
|
42
|
+
var _SetNewPassword = _interopRequireDefault(require("./views/SetNewPassword"));
|
|
43
|
+
|
|
44
|
+
var _SignedIn = _interopRequireDefault(require("./views/SignedIn"));
|
|
45
|
+
|
|
46
|
+
var _appSecurity = require("@webiny/app-security");
|
|
47
|
+
|
|
48
|
+
var _config = require("@webiny/app/config");
|
|
49
|
+
|
|
50
|
+
var _LoggingIn = _interopRequireDefault(require("./views/LoggingIn"));
|
|
51
|
+
|
|
52
|
+
var _excluded = ["getIdentityData", "onError"],
|
|
53
|
+
_excluded2 = ["id", "displayName", "type", "permissions"];
|
|
54
|
+
|
|
55
|
+
var createApolloLinkPlugin = function createApolloLinkPlugin() {
|
|
56
|
+
return new _ApolloLinkPlugin.ApolloLinkPlugin(function () {
|
|
57
|
+
return (0, _apolloLinkContext.setContext)( /*#__PURE__*/function () {
|
|
58
|
+
var _ref2 = (0, _asyncToGenerator2.default)( /*#__PURE__*/(0, _regeneratorRuntime2.default)().mark(function _callee(_, _ref) {
|
|
59
|
+
var headers, user, idToken;
|
|
60
|
+
return (0, _regeneratorRuntime2.default)().wrap(function _callee$(_context) {
|
|
61
|
+
while (1) {
|
|
62
|
+
switch (_context.prev = _context.next) {
|
|
63
|
+
case 0:
|
|
64
|
+
headers = _ref.headers;
|
|
65
|
+
_context.next = 3;
|
|
66
|
+
return _auth.Auth.currentSession();
|
|
67
|
+
|
|
68
|
+
case 3:
|
|
69
|
+
user = _context.sent;
|
|
70
|
+
idToken = user.getIdToken();
|
|
71
|
+
|
|
72
|
+
if (idToken) {
|
|
73
|
+
_context.next = 7;
|
|
74
|
+
break;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
return _context.abrupt("return", {
|
|
78
|
+
headers: headers
|
|
79
|
+
});
|
|
80
|
+
|
|
81
|
+
case 7:
|
|
82
|
+
if (!(headers && headers.Authorization)) {
|
|
83
|
+
_context.next = 9;
|
|
84
|
+
break;
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
return _context.abrupt("return", {
|
|
88
|
+
headers: headers
|
|
89
|
+
});
|
|
90
|
+
|
|
91
|
+
case 9:
|
|
92
|
+
return _context.abrupt("return", {
|
|
93
|
+
headers: (0, _objectSpread2.default)((0, _objectSpread2.default)({}, headers), {}, {
|
|
94
|
+
Authorization: "Bearer ".concat(idToken.getJwtToken())
|
|
95
|
+
})
|
|
96
|
+
});
|
|
97
|
+
|
|
98
|
+
case 10:
|
|
99
|
+
case "end":
|
|
100
|
+
return _context.stop();
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
}, _callee);
|
|
104
|
+
}));
|
|
105
|
+
|
|
106
|
+
return function (_x, _x2) {
|
|
107
|
+
return _ref2.apply(this, arguments);
|
|
108
|
+
};
|
|
109
|
+
}());
|
|
110
|
+
});
|
|
111
|
+
};
|
|
112
|
+
|
|
113
|
+
var defaultOptions = {
|
|
114
|
+
region: _config.config.getKey("USER_POOL_REGION", process.env.REACT_APP_USER_POOL_REGION),
|
|
115
|
+
userPoolId: _config.config.getKey("USER_POOL_ID", process.env.REACT_APP_USER_POOL_ID),
|
|
116
|
+
userPoolWebClientId: _config.config.getKey("USER_POOL_WEB_CLIENT_ID", process.env.REACT_APP_USER_POOL_WEB_CLIENT_ID)
|
|
117
|
+
};
|
|
118
|
+
|
|
119
|
+
var createAuthentication = function createAuthentication(_ref3) {
|
|
120
|
+
var getIdentityData = _ref3.getIdentityData,
|
|
121
|
+
onError = _ref3.onError,
|
|
122
|
+
config = (0, _objectWithoutProperties2.default)(_ref3, _excluded);
|
|
123
|
+
|
|
124
|
+
/**
|
|
125
|
+
* TODO @ts-refactor
|
|
126
|
+
*/
|
|
127
|
+
// @ts-ignore
|
|
128
|
+
Object.keys(config).forEach(function (key) {
|
|
129
|
+
return config[key] === undefined && delete config[key];
|
|
130
|
+
});
|
|
131
|
+
|
|
132
|
+
_auth.Auth.configure((0, _objectSpread2.default)((0, _objectSpread2.default)({}, defaultOptions), config));
|
|
133
|
+
|
|
134
|
+
var Authentication = function Authentication(props) {
|
|
135
|
+
var children = props.children;
|
|
136
|
+
|
|
137
|
+
var _useState = (0, _react.useState)(false),
|
|
138
|
+
_useState2 = (0, _slicedToArray2.default)(_useState, 2),
|
|
139
|
+
loadingIdentity = _useState2[0],
|
|
140
|
+
setLoadingIdentity = _useState2[1];
|
|
141
|
+
|
|
142
|
+
var _useSecurity = (0, _appSecurity.useSecurity)(),
|
|
143
|
+
setIdentity = _useSecurity.setIdentity;
|
|
144
|
+
|
|
145
|
+
var client = (0, _reactHooks.useApolloClient)();
|
|
146
|
+
var onToken = (0, _react.useCallback)( /*#__PURE__*/function () {
|
|
147
|
+
var _ref4 = (0, _asyncToGenerator2.default)( /*#__PURE__*/(0, _regeneratorRuntime2.default)().mark(function _callee2(token) {
|
|
148
|
+
var payload, logout, _yield$getIdentityDat, id, displayName, type, permissions, data;
|
|
149
|
+
|
|
150
|
+
return (0, _regeneratorRuntime2.default)().wrap(function _callee2$(_context2) {
|
|
151
|
+
while (1) {
|
|
152
|
+
switch (_context2.prev = _context2.next) {
|
|
153
|
+
case 0:
|
|
154
|
+
payload = token.payload, logout = token.logout;
|
|
155
|
+
setLoadingIdentity(true);
|
|
156
|
+
_context2.prev = 2;
|
|
157
|
+
_context2.next = 5;
|
|
158
|
+
return getIdentityData({
|
|
159
|
+
client: client,
|
|
160
|
+
payload: payload
|
|
161
|
+
});
|
|
162
|
+
|
|
163
|
+
case 5:
|
|
164
|
+
_yield$getIdentityDat = _context2.sent;
|
|
165
|
+
id = _yield$getIdentityDat.id;
|
|
166
|
+
displayName = _yield$getIdentityDat.displayName;
|
|
167
|
+
type = _yield$getIdentityDat.type;
|
|
168
|
+
permissions = _yield$getIdentityDat.permissions;
|
|
169
|
+
data = (0, _objectWithoutProperties2.default)(_yield$getIdentityDat, _excluded2);
|
|
170
|
+
setIdentity((0, _objectSpread2.default)((0, _objectSpread2.default)({
|
|
171
|
+
id: id,
|
|
172
|
+
displayName: displayName,
|
|
173
|
+
type: type,
|
|
174
|
+
permissions: permissions
|
|
175
|
+
}, data), {}, {
|
|
176
|
+
logout: logout || function () {
|
|
177
|
+
return void 0;
|
|
178
|
+
}
|
|
179
|
+
}));
|
|
180
|
+
_context2.next = 18;
|
|
181
|
+
break;
|
|
182
|
+
|
|
183
|
+
case 14:
|
|
184
|
+
_context2.prev = 14;
|
|
185
|
+
_context2.t0 = _context2["catch"](2);
|
|
186
|
+
console.log("ERROR", _context2.t0);
|
|
187
|
+
|
|
188
|
+
if (typeof onError === "function") {
|
|
189
|
+
onError(_context2.t0);
|
|
190
|
+
} else {
|
|
191
|
+
console.error(_context2.t0);
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
case 18:
|
|
195
|
+
_context2.prev = 18;
|
|
196
|
+
setLoadingIdentity(false);
|
|
197
|
+
return _context2.finish(18);
|
|
198
|
+
|
|
199
|
+
case 21:
|
|
200
|
+
case "end":
|
|
201
|
+
return _context2.stop();
|
|
202
|
+
}
|
|
203
|
+
}
|
|
204
|
+
}, _callee2, null, [[2, 14, 18, 21]]);
|
|
205
|
+
}));
|
|
206
|
+
|
|
207
|
+
return function (_x3) {
|
|
208
|
+
return _ref4.apply(this, arguments);
|
|
209
|
+
};
|
|
210
|
+
}(), []);
|
|
211
|
+
(0, _react.useEffect)(function () {
|
|
212
|
+
_plugins.plugins.register(createApolloLinkPlugin());
|
|
213
|
+
}, []);
|
|
214
|
+
return /*#__PURE__*/_react.default.createElement(_Authenticator.Authenticator, {
|
|
215
|
+
onToken: onToken
|
|
216
|
+
}, loadingIdentity ? /*#__PURE__*/_react.default.createElement(_LoggingIn.default, null) : /*#__PURE__*/_react.default.createElement(_SignIn.default, null), /*#__PURE__*/_react.default.createElement(_RequireNewPassword.default, null), /*#__PURE__*/_react.default.createElement(_ForgotPassword.default, null), /*#__PURE__*/_react.default.createElement(_SetNewPassword.default, null), /*#__PURE__*/_react.default.createElement(_SignedIn.default, null, children));
|
|
217
|
+
};
|
|
218
|
+
|
|
219
|
+
return Authentication;
|
|
220
|
+
};
|
|
221
|
+
|
|
222
|
+
exports.createAuthentication = createAuthentication;
|
package/index.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["createApolloLinkPlugin","ApolloLinkPlugin","setContext","_","headers","Auth","currentSession","user","idToken","getIdToken","Authorization","getJwtToken","defaultOptions","region","appConfig","getKey","process","env","REACT_APP_USER_POOL_REGION","userPoolId","REACT_APP_USER_POOL_ID","userPoolWebClientId","REACT_APP_USER_POOL_WEB_CLIENT_ID","createAuthentication","getIdentityData","onError","config","Object","keys","forEach","key","undefined","configure","Authentication","props","children","useState","loadingIdentity","setLoadingIdentity","useSecurity","setIdentity","client","useApolloClient","onToken","useCallback","token","payload","logout","id","displayName","type","permissions","data","console","log","error","useEffect","plugins","register"],"sources":["index.tsx"],"sourcesContent":["import React, { useCallback, useEffect, useState } from \"react\";\nimport { Auth } from \"@aws-amplify/auth\";\nimport { AuthOptions } from \"@aws-amplify/auth/lib-esm/types\";\nimport ApolloClient from \"apollo-client\";\nimport { useApolloClient } from \"@apollo/react-hooks\";\nimport { setContext } from \"apollo-link-context\";\nimport { plugins } from \"@webiny/plugins\";\nimport { ApolloLinkPlugin } from \"@webiny/app/plugins/ApolloLinkPlugin\";\nimport { CognitoIdToken } from \"@webiny/app-cognito-authenticator/types\";\nimport { Authenticator } from \"@webiny/app-cognito-authenticator/Authenticator\";\nimport SignIn from \"~/views/SignIn\";\nimport RequireNewPassword from \"~/views/RequireNewPassword\";\nimport ForgotPassword from \"~/views/ForgotPassword\";\nimport SetNewPassword from \"~/views/SetNewPassword\";\nimport SignedIn from \"~/views/SignedIn\";\nimport { useSecurity } from \"@webiny/app-security\";\nimport { config as appConfig } from \"@webiny/app/config\";\nimport LoggingIn from \"~/views/LoggingIn\";\n\nconst createApolloLinkPlugin = (): ApolloLinkPlugin => {\n return new ApolloLinkPlugin(() => {\n return setContext(async (_, { headers }) => {\n const user = await Auth.currentSession();\n const idToken = user.getIdToken();\n\n if (!idToken) {\n return { headers };\n }\n\n // If \"Authorization\" header is already set, don't overwrite it.\n if (headers && headers.Authorization) {\n return { headers };\n }\n\n return {\n headers: {\n ...headers,\n Authorization: `Bearer ${idToken.getJwtToken()}`\n }\n };\n });\n });\n};\n\nconst defaultOptions = {\n region: appConfig.getKey(\"USER_POOL_REGION\", process.env.REACT_APP_USER_POOL_REGION),\n userPoolId: appConfig.getKey(\"USER_POOL_ID\", process.env.REACT_APP_USER_POOL_ID),\n userPoolWebClientId: appConfig.getKey(\n \"USER_POOL_WEB_CLIENT_ID\",\n process.env.REACT_APP_USER_POOL_WEB_CLIENT_ID\n )\n};\n\nexport interface AuthenticationProps {\n children: React.ReactNode;\n}\n\nexport interface AuthenticationFactoryConfig extends AuthOptions {\n onError?(error: Error): void;\n getIdentityData(params: {\n client: ApolloClient<any>;\n payload: { [key: string]: any };\n }): Promise<{ [key: string]: any }>;\n}\n\ninterface AuthenticationFactory {\n (params: AuthenticationFactoryConfig): React.FC<AuthenticationProps>;\n}\nexport const createAuthentication: AuthenticationFactory = ({\n getIdentityData,\n onError,\n ...config\n}) => {\n /**\n * TODO @ts-refactor\n */\n // @ts-ignore\n Object.keys(config).forEach(key => config[key] === undefined && delete config[key]);\n Auth.configure({ ...defaultOptions, ...config });\n\n const Authentication: React.FC<AuthenticationProps> = props => {\n const { children } = props;\n const [loadingIdentity, setLoadingIdentity] = useState(false);\n const { setIdentity } = useSecurity();\n const client = useApolloClient();\n\n const onToken = useCallback(async (token: CognitoIdToken) => {\n const { payload, logout } = token;\n\n setLoadingIdentity(true);\n\n try {\n const { id, displayName, type, permissions, ...data } = await getIdentityData({\n client,\n payload\n });\n\n setIdentity({\n id,\n displayName,\n type,\n permissions,\n ...data,\n logout:\n logout ||\n (() => {\n return void 0;\n })\n });\n } catch (err) {\n console.log(\"ERROR\", err);\n if (typeof onError === \"function\") {\n onError(err);\n } else {\n console.error(err);\n }\n } finally {\n setLoadingIdentity(false);\n }\n }, []);\n\n useEffect(() => {\n plugins.register(createApolloLinkPlugin());\n }, []);\n\n return (\n <Authenticator onToken={onToken}>\n {loadingIdentity ? <LoggingIn /> : <SignIn />}\n <RequireNewPassword />\n <ForgotPassword />\n <SetNewPassword />\n <SignedIn>{children}</SignedIn>\n </Authenticator>\n );\n };\n\n return Authentication;\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA;;AACA;;AAGA;;AACA;;AACA;;AACA;;AAEA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;;;;AAEA,IAAMA,sBAAsB,GAAG,SAAzBA,sBAAyB,GAAwB;EACnD,OAAO,IAAIC,kCAAJ,CAAqB,YAAM;IAC9B,OAAO,IAAAC,6BAAA;MAAA,mGAAW,iBAAOC,CAAP;QAAA;QAAA;UAAA;YAAA;cAAA;gBAAYC,OAAZ,QAAYA,OAAZ;gBAAA;gBAAA,OACKC,UAAA,CAAKC,cAAL,EADL;;cAAA;gBACRC,IADQ;gBAERC,OAFQ,GAEED,IAAI,CAACE,UAAL,EAFF;;gBAAA,IAITD,OAJS;kBAAA;kBAAA;gBAAA;;gBAAA,iCAKH;kBAAEJ,OAAO,EAAPA;gBAAF,CALG;;cAAA;gBAAA,MASVA,OAAO,IAAIA,OAAO,CAACM,aATT;kBAAA;kBAAA;gBAAA;;gBAAA,iCAUH;kBAAEN,OAAO,EAAPA;gBAAF,CAVG;;cAAA;gBAAA,iCAaP;kBACHA,OAAO,8DACAA,OADA;oBAEHM,aAAa,mBAAYF,OAAO,CAACG,WAAR,EAAZ;kBAFV;gBADJ,CAbO;;cAAA;cAAA;gBAAA;YAAA;UAAA;QAAA;MAAA,CAAX;;MAAA;QAAA;MAAA;IAAA,IAAP;EAoBH,CArBM,CAAP;AAsBH,CAvBD;;AAyBA,IAAMC,cAAc,GAAG;EACnBC,MAAM,EAAEC,cAAA,CAAUC,MAAV,CAAiB,kBAAjB,EAAqCC,OAAO,CAACC,GAAR,CAAYC,0BAAj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+
"name": "@webiny/app-admin-cognito",
|
|
3
|
+
"version": "0.0.0-ee-vpcs.549378cf03",
|
|
4
|
+
"main": "index.js",
|
|
5
|
+
"repository": {
|
|
6
|
+
"type": "git",
|
|
7
|
+
"url": "https://github.com/webiny/webiny-js.git"
|
|
8
|
+
},
|
|
9
|
+
"description": "Identity provider plugin for AWS Cognito",
|
|
10
|
+
"contributors": [
|
|
11
|
+
"Pavel Denisjuk <pavel@webiny.com>"
|
|
12
|
+
],
|
|
13
|
+
"license": "MIT",
|
|
14
|
+
"dependencies": {
|
|
15
|
+
"@apollo/react-hooks": "3.1.5",
|
|
16
|
+
"@aws-amplify/auth": "4.6.8",
|
|
17
|
+
"@emotion/styled": "10.3.0",
|
|
18
|
+
"@webiny/app": "0.0.0-ee-vpcs.549378cf03",
|
|
19
|
+
"@webiny/app-admin": "0.0.0-ee-vpcs.549378cf03",
|
|
20
|
+
"@webiny/app-cognito-authenticator": "0.0.0-ee-vpcs.549378cf03",
|
|
21
|
+
"@webiny/app-security": "0.0.0-ee-vpcs.549378cf03",
|
|
22
|
+
"@webiny/form": "0.0.0-ee-vpcs.549378cf03",
|
|
23
|
+
"@webiny/plugins": "0.0.0-ee-vpcs.549378cf03",
|
|
24
|
+
"@webiny/ui": "0.0.0-ee-vpcs.549378cf03",
|
|
25
|
+
"@webiny/validation": "0.0.0-ee-vpcs.549378cf03",
|
|
26
|
+
"apollo-client": "2.6.10",
|
|
27
|
+
"apollo-link-context": "1.0.20",
|
|
28
|
+
"emotion": "10.0.27",
|
|
29
|
+
"react": "17.0.2",
|
|
30
|
+
"react-dom": "17.0.2"
|
|
31
|
+
},
|
|
32
|
+
"devDependencies": {
|
|
33
|
+
"@babel/cli": "^7.19.3",
|
|
34
|
+
"@babel/core": "^7.19.3",
|
|
35
|
+
"@babel/plugin-proposal-class-properties": "^7.16.0",
|
|
36
|
+
"@babel/plugin-proposal-throw-expressions": "^7.16.0",
|
|
37
|
+
"@babel/preset-env": "^7.19.4",
|
|
38
|
+
"@babel/preset-react": "^7.16.0",
|
|
39
|
+
"@babel/preset-typescript": "^7.18.6",
|
|
40
|
+
"@webiny/cli": "^0.0.0-ee-vpcs.549378cf03",
|
|
41
|
+
"@webiny/project-utils": "^0.0.0-ee-vpcs.549378cf03",
|
|
42
|
+
"babel-plugin-lodash": "^3.3.4",
|
|
43
|
+
"rimraf": "^3.0.2",
|
|
44
|
+
"ttypescript": "^1.5.12",
|
|
45
|
+
"typescript": "4.7.4"
|
|
46
|
+
},
|
|
47
|
+
"publishConfig": {
|
|
48
|
+
"access": "public",
|
|
49
|
+
"directory": "dist"
|
|
50
|
+
},
|
|
51
|
+
"scripts": {
|
|
52
|
+
"build": "yarn webiny run build",
|
|
53
|
+
"watch": "yarn webiny run watch"
|
|
54
|
+
},
|
|
55
|
+
"adio": {
|
|
56
|
+
"ignore": {
|
|
57
|
+
"peerDependencies": [
|
|
58
|
+
"react-dom"
|
|
59
|
+
]
|
|
60
|
+
}
|
|
61
|
+
},
|
|
62
|
+
"gitHead": "549378cf03fcd27845fc3fa23d1dc6b32896f630"
|
|
63
|
+
}
|
package/types.d.ts
ADDED
|
File without changes
|
package/types.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";
|
package/types.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":[],"sources":["types.ts"],"sourcesContent":[""],"mappings":""}
|
|
@@ -0,0 +1,140 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
4
|
+
|
|
5
|
+
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard").default;
|
|
6
|
+
|
|
7
|
+
Object.defineProperty(exports, "__esModule", {
|
|
8
|
+
value: true
|
|
9
|
+
});
|
|
10
|
+
exports.default = void 0;
|
|
11
|
+
|
|
12
|
+
var React = _interopRequireWildcard(require("react"));
|
|
13
|
+
|
|
14
|
+
var _form = require("@webiny/form");
|
|
15
|
+
|
|
16
|
+
var _validation = require("@webiny/validation");
|
|
17
|
+
|
|
18
|
+
var _Button = require("@webiny/ui/Button");
|
|
19
|
+
|
|
20
|
+
var _Input = require("@webiny/ui/Input");
|
|
21
|
+
|
|
22
|
+
var _Grid = require("@webiny/ui/Grid");
|
|
23
|
+
|
|
24
|
+
var _Typography = require("@webiny/ui/Typography");
|
|
25
|
+
|
|
26
|
+
var _Alert = require("@webiny/ui/Alert");
|
|
27
|
+
|
|
28
|
+
var _Elevation = require("@webiny/ui/Elevation");
|
|
29
|
+
|
|
30
|
+
var _StateContainer = _interopRequireDefault(require("./StateContainer"));
|
|
31
|
+
|
|
32
|
+
var _StyledComponents = require("./StyledComponents");
|
|
33
|
+
|
|
34
|
+
var _Progress = require("@webiny/ui/Progress");
|
|
35
|
+
|
|
36
|
+
var _useAuthenticator2 = require("@webiny/app-cognito-authenticator/hooks/useAuthenticator");
|
|
37
|
+
|
|
38
|
+
var _useForgotPassword2 = require("@webiny/app-cognito-authenticator/hooks/useForgotPassword");
|
|
39
|
+
|
|
40
|
+
var ForgotPassword = function ForgotPassword() {
|
|
41
|
+
var _useAuthenticator = (0, _useAuthenticator2.useAuthenticator)(),
|
|
42
|
+
authData = _useAuthenticator.authData,
|
|
43
|
+
changeState = _useAuthenticator.changeState;
|
|
44
|
+
|
|
45
|
+
var _useForgotPassword = (0, _useForgotPassword2.useForgotPassword)(),
|
|
46
|
+
loading = _useForgotPassword.loading,
|
|
47
|
+
codeSent = _useForgotPassword.codeSent,
|
|
48
|
+
shouldRender = _useForgotPassword.shouldRender,
|
|
49
|
+
setPassword = _useForgotPassword.setPassword,
|
|
50
|
+
requestCode = _useForgotPassword.requestCode,
|
|
51
|
+
error = _useForgotPassword.error;
|
|
52
|
+
|
|
53
|
+
if (!shouldRender) {
|
|
54
|
+
return null;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
var _ref = authData || {},
|
|
58
|
+
_ref$username = _ref.username,
|
|
59
|
+
username = _ref$username === void 0 ? "" : _ref$username;
|
|
60
|
+
|
|
61
|
+
return /*#__PURE__*/React.createElement(_StateContainer.default, null, /*#__PURE__*/React.createElement(_form.Form, {
|
|
62
|
+
data: {
|
|
63
|
+
username: username
|
|
64
|
+
},
|
|
65
|
+
onSubmit: function onSubmit(_ref2) {
|
|
66
|
+
var username = _ref2.username;
|
|
67
|
+
return codeSent ? setPassword({
|
|
68
|
+
username: username
|
|
69
|
+
}) : requestCode({
|
|
70
|
+
username: username
|
|
71
|
+
});
|
|
72
|
+
},
|
|
73
|
+
submitOnEnter: true
|
|
74
|
+
}, function (_ref3) {
|
|
75
|
+
var Bind = _ref3.Bind,
|
|
76
|
+
submit = _ref3.submit,
|
|
77
|
+
data = _ref3.data;
|
|
78
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(_Elevation.Elevation, {
|
|
79
|
+
z: 2
|
|
80
|
+
}, /*#__PURE__*/React.createElement(_StyledComponents.InnerContent, null, loading && /*#__PURE__*/React.createElement(_Progress.CircularProgress, null), /*#__PURE__*/React.createElement(_StyledComponents.Title, null, /*#__PURE__*/React.createElement("h1", null, /*#__PURE__*/React.createElement(_Typography.Typography, {
|
|
81
|
+
use: "headline4"
|
|
82
|
+
}, "Password Recovery")), /*#__PURE__*/React.createElement("p", null, /*#__PURE__*/React.createElement(_Typography.Typography, {
|
|
83
|
+
use: "body2"
|
|
84
|
+
}, "request a password reset code"))), error && /*#__PURE__*/React.createElement(_Grid.Grid, null, /*#__PURE__*/React.createElement(_Grid.Cell, {
|
|
85
|
+
span: 12
|
|
86
|
+
}, /*#__PURE__*/React.createElement(_Alert.Alert, {
|
|
87
|
+
title: "Something went wrong",
|
|
88
|
+
type: "danger"
|
|
89
|
+
}, error))), !codeSent ? /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(_Grid.Grid, null, /*#__PURE__*/React.createElement(_Grid.Cell, {
|
|
90
|
+
span: 12
|
|
91
|
+
}, /*#__PURE__*/React.createElement(Bind, {
|
|
92
|
+
name: "username",
|
|
93
|
+
validators: _validation.validation.create("required"),
|
|
94
|
+
beforeChange: function beforeChange(val, cb) {
|
|
95
|
+
return cb(val.toLowerCase());
|
|
96
|
+
}
|
|
97
|
+
}, /*#__PURE__*/React.createElement(_Input.Input, {
|
|
98
|
+
label: "Email",
|
|
99
|
+
description: "A reset code will be sent to your email."
|
|
100
|
+
})))), /*#__PURE__*/React.createElement(_Grid.Grid, null, /*#__PURE__*/React.createElement(_Grid.Cell, {
|
|
101
|
+
span: 12,
|
|
102
|
+
className: _StyledComponents.alignRight
|
|
103
|
+
}, /*#__PURE__*/React.createElement(_Button.ButtonPrimary, {
|
|
104
|
+
onClick: function onClick(ev) {
|
|
105
|
+
submit(ev);
|
|
106
|
+
},
|
|
107
|
+
"data-testid": "send-code"
|
|
108
|
+
}, "Send me the code")))) : /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(_Grid.Grid, null, /*#__PURE__*/React.createElement(_Grid.Cell, {
|
|
109
|
+
span: 12
|
|
110
|
+
}, /*#__PURE__*/React.createElement(_Typography.Typography, {
|
|
111
|
+
use: "body1"
|
|
112
|
+
}, "We have sent you a code to reset your password!", /*#__PURE__*/React.createElement("br", null), /*#__PURE__*/React.createElement("br", null), "Click the \"Resend code\" button below to resend the code in case you haven't received it the first time."))), /*#__PURE__*/React.createElement(_Grid.Grid, null, /*#__PURE__*/React.createElement(_Grid.Cell, {
|
|
113
|
+
span: 12,
|
|
114
|
+
className: _StyledComponents.alignRight
|
|
115
|
+
}, /*#__PURE__*/React.createElement(_Button.ButtonDefault, {
|
|
116
|
+
onClick: function onClick() {
|
|
117
|
+
requestCode({
|
|
118
|
+
username: data.username
|
|
119
|
+
});
|
|
120
|
+
}
|
|
121
|
+
}, "Resend code"), /*#__PURE__*/React.createElement(_Button.ButtonPrimary, {
|
|
122
|
+
onClick: function onClick(ev) {
|
|
123
|
+
submit(ev);
|
|
124
|
+
}
|
|
125
|
+
}, "I got the code!")))))), /*#__PURE__*/React.createElement(_Grid.Grid, null, /*#__PURE__*/React.createElement(_Grid.Cell, {
|
|
126
|
+
span: 12,
|
|
127
|
+
style: {
|
|
128
|
+
textAlign: "center"
|
|
129
|
+
}
|
|
130
|
+
}, "Want to sign in? ", /*#__PURE__*/React.createElement("a", {
|
|
131
|
+
href: "#",
|
|
132
|
+
onClick: function onClick() {
|
|
133
|
+
return changeState("signIn");
|
|
134
|
+
}
|
|
135
|
+
}, "Sign in"))));
|
|
136
|
+
}));
|
|
137
|
+
};
|
|
138
|
+
|
|
139
|
+
var _default = ForgotPassword;
|
|
140
|
+
exports.default = _default;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["ForgotPassword","useAuthenticator","authData","changeState","useForgotPassword","loading","codeSent","shouldRender","setPassword","requestCode","error","username","Bind","submit","data","validation","create","val","cb","toLowerCase","alignRight","ev","textAlign"],"sources":["ForgotPassword.tsx"],"sourcesContent":["import * as React from \"react\";\nimport { Form } from \"@webiny/form\";\nimport { validation } from \"@webiny/validation\";\nimport { ButtonPrimary, ButtonDefault } from \"@webiny/ui/Button\";\nimport { Input } from \"@webiny/ui/Input\";\nimport { Grid, Cell } from \"@webiny/ui/Grid\";\nimport { Typography } from \"@webiny/ui/Typography\";\nimport { Alert } from \"@webiny/ui/Alert\";\nimport { Elevation } from \"@webiny/ui/Elevation\";\nimport StateContainer from \"./StateContainer\";\nimport { alignRight, InnerContent, Title } from \"./StyledComponents\";\nimport { CircularProgress } from \"@webiny/ui/Progress\";\nimport { useAuthenticator } from \"@webiny/app-cognito-authenticator/hooks/useAuthenticator\";\nimport { useForgotPassword } from \"@webiny/app-cognito-authenticator/hooks/useForgotPassword\";\n\nconst ForgotPassword: React.FC = () => {\n const { authData, changeState } = useAuthenticator();\n const { loading, codeSent, shouldRender, setPassword, requestCode, error } =\n useForgotPassword();\n\n if (!shouldRender) {\n return null;\n }\n\n const { username = \"\" } = authData || {};\n\n return (\n <StateContainer>\n <Form\n data={{ username }}\n onSubmit={({ username }) =>\n codeSent ? setPassword({ username }) : requestCode({ username })\n }\n submitOnEnter\n >\n {({ Bind, submit, data }) => (\n <>\n <Elevation z={2}>\n <InnerContent>\n {loading && <CircularProgress />}\n <Title>\n <h1>\n <Typography use=\"headline4\">Password Recovery</Typography>\n </h1>\n <p>\n <Typography use=\"body2\">\n request a password reset code\n </Typography>\n </p>\n </Title>\n\n {error && (\n <Grid>\n <Cell span={12}>\n <Alert title={\"Something went wrong\"} type={\"danger\"}>\n {error}\n </Alert>\n </Cell>\n </Grid>\n )}\n\n {!codeSent ? (\n <>\n <Grid>\n <Cell span={12}>\n <Bind\n name=\"username\"\n validators={validation.create(\"required\")}\n beforeChange={(\n val: string,\n cb: (value: string) => void\n ) => cb(val.toLowerCase())}\n >\n <Input\n label={\"Email\"}\n description={\n \"A reset code will be sent to your email.\"\n }\n />\n </Bind>\n </Cell>\n </Grid>\n\n <Grid>\n <Cell span={12} className={alignRight}>\n <ButtonPrimary\n onClick={ev => {\n submit(ev);\n }}\n data-testid=\"send-code\"\n >\n {\"Send me the code\"}\n </ButtonPrimary>\n </Cell>\n </Grid>\n </>\n ) : (\n <>\n <Grid>\n <Cell span={12}>\n <Typography use=\"body1\">\n We have sent you a code to reset your password!\n <br />\n <br />\n Click the "Resend code" button below\n to resend the code in case you haven't\n received it the first time.\n </Typography>\n </Cell>\n </Grid>\n <Grid>\n <Cell span={12} className={alignRight}>\n <ButtonDefault\n onClick={() => {\n requestCode({ username: data.username });\n }}\n >\n {\"Resend code\"}\n </ButtonDefault>\n <ButtonPrimary\n onClick={ev => {\n submit(ev);\n }}\n >\n I got the code!\n </ButtonPrimary>\n </Cell>\n </Grid>\n </>\n )}\n </InnerContent>\n </Elevation>\n <Grid>\n <Cell span={12} style={{ textAlign: \"center\" }}>\n Want to sign in? {/* eslint-disable-next-line */}\n <a href={\"#\"} onClick={() => changeState(\"signIn\")}>\n Sign in\n </a>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AI,EAAE,EAAZ;MAAgB,SAAS,EAAED;IAA3B,gBACI,oBAAC,qBAAD;MACI,OAAO,EAAE,mBAAM;QACXX,WAAW,CAAC;UAAEE,QAAQ,EAAEG,IAAI,CAACH;QAAjB,CAAD,CAAX;MACH;IAHL,GAKK,aALL,CADJ,eAQI,oBAAC,qBAAD;MACI,OAAO,EAAE,iBAAAU,EAAE,EAAI;QACXR,MAAM,CAACQ,EAAD,CAAN;MACH;IAHL,qBARJ,CADJ,CAbJ,CA3DR,CADJ,CADJ,eAgGI,oBAAC,UAAD,qBACI,oBAAC,UAAD;MAAM,IAAI,EAAE,EAAZ;MAAgB,KAAK,EAAE;QAAEC,SAAS,EAAE;MAAb;IAAvB,qCAEI;MAAG,IAAI,EAAE,GAAT;MAAc,OAAO,EAAE;QAAA,OAAMnB,WAAW,CAAC,QAAD,CAAjB;MAAA;IAAvB,aAFJ,CADJ,CAhGJ,CADH;EAAA,CAPL,CADJ,CADJ;AAuHH,CAlID;;eAoIeH,c"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
4
|
+
|
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
|
6
|
+
value: true
|
|
7
|
+
});
|
|
8
|
+
exports.default = void 0;
|
|
9
|
+
|
|
10
|
+
var _react = _interopRequireDefault(require("react"));
|
|
11
|
+
|
|
12
|
+
var _Progress = require("@webiny/ui/Progress");
|
|
13
|
+
|
|
14
|
+
var LoggingIn = function LoggingIn() {
|
|
15
|
+
return /*#__PURE__*/_react.default.createElement(_Progress.CircularProgress, {
|
|
16
|
+
label: "Loading identity..."
|
|
17
|
+
});
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
var _default = LoggingIn;
|
|
21
|
+
exports.default = _default;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["LoggingIn"],"sources":["LoggingIn.tsx"],"sourcesContent":["import React from \"react\";\nimport { CircularProgress } from \"@webiny/ui/Progress\";\n\nconst LoggingIn: React.FC = () => {\n return <CircularProgress label={\"Loading identity...\"} />;\n};\n\nexport default LoggingIn;\n"],"mappings":";;;;;;;;;AAAA;;AACA;;AAEA,IAAMA,SAAmB,GAAG,SAAtBA,SAAsB,GAAM;EAC9B,oBAAO,6BAAC,0BAAD;IAAkB,KAAK,EAAE;EAAzB,EAAP;AACH,CAFD;;eAIeA,S"}
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
4
|
+
|
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
|
6
|
+
value: true
|
|
7
|
+
});
|
|
8
|
+
exports.default = void 0;
|
|
9
|
+
|
|
10
|
+
var _react = _interopRequireDefault(require("react"));
|
|
11
|
+
|
|
12
|
+
var _form = require("@webiny/form");
|
|
13
|
+
|
|
14
|
+
var _validation = require("@webiny/validation");
|
|
15
|
+
|
|
16
|
+
var _Button = require("@webiny/ui/Button");
|
|
17
|
+
|
|
18
|
+
var _Input = require("@webiny/ui/Input");
|
|
19
|
+
|
|
20
|
+
var _Grid = require("@webiny/ui/Grid");
|
|
21
|
+
|
|
22
|
+
var _Typography = require("@webiny/ui/Typography");
|
|
23
|
+
|
|
24
|
+
var _Elevation = require("@webiny/ui/Elevation");
|
|
25
|
+
|
|
26
|
+
var _useRequireNewPassword = require("@webiny/app-cognito-authenticator/hooks/useRequireNewPassword");
|
|
27
|
+
|
|
28
|
+
var _StateContainer = _interopRequireDefault(require("./StateContainer"));
|
|
29
|
+
|
|
30
|
+
var _StyledComponents = require("./StyledComponents");
|
|
31
|
+
|
|
32
|
+
var sentenceCase = function sentenceCase(str) {
|
|
33
|
+
var lower = str.toLowerCase();
|
|
34
|
+
return lower[0].toUpperCase() + lower.substring(1);
|
|
35
|
+
};
|
|
36
|
+
|
|
37
|
+
var RequireNewPassword = function RequireNewPassword() {
|
|
38
|
+
var _useRequireNewPasswor = (0, _useRequireNewPassword.useRequireNewPassword)(),
|
|
39
|
+
shouldRender = _useRequireNewPasswor.shouldRender,
|
|
40
|
+
requiredAttributes = _useRequireNewPasswor.requiredAttributes,
|
|
41
|
+
confirm = _useRequireNewPasswor.confirm;
|
|
42
|
+
|
|
43
|
+
if (!shouldRender) {
|
|
44
|
+
return null;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
return /*#__PURE__*/_react.default.createElement(_StateContainer.default, null, /*#__PURE__*/_react.default.createElement(_form.Form, {
|
|
48
|
+
onSubmit: function onSubmit(_ref) {
|
|
49
|
+
var password = _ref.password,
|
|
50
|
+
requiredAttributes = _ref.requiredAttributes;
|
|
51
|
+
return confirm({
|
|
52
|
+
password: password,
|
|
53
|
+
requiredAttributes: requiredAttributes
|
|
54
|
+
});
|
|
55
|
+
},
|
|
56
|
+
submitOnEnter: true
|
|
57
|
+
}, function (_ref2) {
|
|
58
|
+
var Bind = _ref2.Bind,
|
|
59
|
+
submit = _ref2.submit;
|
|
60
|
+
return /*#__PURE__*/_react.default.createElement(_Elevation.Elevation, {
|
|
61
|
+
z: 2
|
|
62
|
+
}, /*#__PURE__*/_react.default.createElement(_StyledComponents.InnerContent, null, /*#__PURE__*/_react.default.createElement(_StyledComponents.Title, null, /*#__PURE__*/_react.default.createElement(_Typography.Typography, {
|
|
63
|
+
use: "headline4"
|
|
64
|
+
}, "Set New Password")), /*#__PURE__*/_react.default.createElement(_Grid.Grid, null, /*#__PURE__*/_react.default.createElement(_Grid.Cell, {
|
|
65
|
+
span: 12
|
|
66
|
+
}, /*#__PURE__*/_react.default.createElement(Bind, {
|
|
67
|
+
name: "password",
|
|
68
|
+
validators: _validation.validation.create("required")
|
|
69
|
+
}, /*#__PURE__*/_react.default.createElement(_Input.Input, {
|
|
70
|
+
type: "password",
|
|
71
|
+
label: "New password",
|
|
72
|
+
outlined: true
|
|
73
|
+
})))), requiredAttributes.length > 0 && /*#__PURE__*/_react.default.createElement(_StyledComponents.Title, null, /*#__PURE__*/_react.default.createElement(_Typography.Typography, {
|
|
74
|
+
use: "headline6"
|
|
75
|
+
}, "Please enter additional information")), /*#__PURE__*/_react.default.createElement(_Grid.Grid, null, requiredAttributes.map(function (name) {
|
|
76
|
+
return /*#__PURE__*/_react.default.createElement(_Grid.Cell, {
|
|
77
|
+
key: name,
|
|
78
|
+
span: 12
|
|
79
|
+
}, /*#__PURE__*/_react.default.createElement(Bind, {
|
|
80
|
+
name: name,
|
|
81
|
+
validators: _validation.validation.create("required")
|
|
82
|
+
}, /*#__PURE__*/_react.default.createElement(_Input.Input, {
|
|
83
|
+
label: sentenceCase(name),
|
|
84
|
+
outlined: true
|
|
85
|
+
})));
|
|
86
|
+
})), /*#__PURE__*/_react.default.createElement(_Grid.Grid, null, /*#__PURE__*/_react.default.createElement(_Grid.Cell, {
|
|
87
|
+
span: 12,
|
|
88
|
+
className: _StyledComponents.alignRight
|
|
89
|
+
}, /*#__PURE__*/_react.default.createElement(_Button.ButtonPrimary, {
|
|
90
|
+
"data-testid": "submit-sign-in-form-button",
|
|
91
|
+
onClick: function onClick(ev) {
|
|
92
|
+
submit(ev);
|
|
93
|
+
}
|
|
94
|
+
}, "Set password")))));
|
|
95
|
+
}));
|
|
96
|
+
};
|
|
97
|
+
|
|
98
|
+
var _default = RequireNewPassword;
|
|
99
|
+
exports.default = _default;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["sentenceCase","str","lower","toLowerCase","toUpperCase","substring","RequireNewPassword","useRequireNewPassword","shouldRender","requiredAttributes","confirm","password","Bind","submit","validation","create","length","map","name","alignRight","ev"],"sources":["RequireNewPassword.tsx"],"sourcesContent":["import React from \"react\";\nimport { Form } from \"@webiny/form\";\nimport { validation } from \"@webiny/validation\";\nimport { ButtonPrimary } from \"@webiny/ui/Button\";\nimport { Input } from \"@webiny/ui/Input\";\nimport { Grid, Cell } from \"@webiny/ui/Grid\";\nimport { Typography } from \"@webiny/ui/Typography\";\nimport { Elevation } from \"@webiny/ui/Elevation\";\nimport { useRequireNewPassword } from \"@webiny/app-cognito-authenticator/hooks/useRequireNewPassword\";\nimport StateContainer from \"./StateContainer\";\nimport { alignRight, InnerContent, Title } from \"./StyledComponents\";\n\nconst sentenceCase = (str: string) => {\n const lower = str.toLowerCase();\n return lower[0].toUpperCase() + lower.substring(1);\n};\n\nconst RequireNewPassword: React.FC = () => {\n const { shouldRender, requiredAttributes, confirm } = useRequireNewPassword();\n\n if (!shouldRender) {\n return null;\n }\n\n return (\n <StateContainer>\n <Form\n onSubmit={({ password, requiredAttributes }) =>\n confirm({ password, requiredAttributes })\n }\n submitOnEnter\n >\n {({ Bind, submit }) => (\n <Elevation z={2}>\n <InnerContent>\n <Title>\n <Typography use=\"headline4\">Set New Password</Typography>\n </Title>\n\n <Grid>\n <Cell span={12}>\n <Bind\n name=\"password\"\n validators={validation.create(\"required\")}\n >\n <Input\n type={\"password\"}\n label={\"New password\"}\n outlined={true}\n />\n </Bind>\n </Cell>\n </Grid>\n {requiredAttributes.length > 0 && (\n <Title>\n <Typography use=\"headline6\">\n Please enter additional information\n </Typography>\n </Title>\n )}\n <Grid>\n {requiredAttributes.map(name => (\n <Cell key={name} span={12}>\n <Bind\n name={name}\n validators={validation.create(\"required\")}\n >\n <Input label={sentenceCase(name)} outlined={true} />\n </Bind>\n </Cell>\n ))}\n </Grid>\n\n <Grid>\n <Cell span={12} className={alignRight}>\n <ButtonPrimary\n data-testid=\"submit-sign-in-form-button\"\n onClick={ev => {\n submit(ev);\n }}\n >\n {\"Set password\"}\n </ButtonPrimary>\n </Cell>\n </Grid>\n </InnerContent>\n </Elevation>\n )}\n </Form>\n </StateContainer>\n );\n};\n\nexport default RequireNewPassword;\n"],"mappings":";;;;;;;;;AAAA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AAEA,IAAMA,YAAY,GAAG,SAAfA,YA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B,iBACG,6BAAC,uBAAD,qBACI,6BAAC,sBAAD;MAAY,GAAG,EAAC;IAAhB,yCADJ,CApBR,eA0BI,6BAAC,UAAD,QACKP,kBAAkB,CAACQ,GAAnB,CAAuB,UAAAC,IAAI;MAAA,oBACxB,6BAAC,UAAD;QAAM,GAAG,EAAEA,IAAX;QAAiB,IAAI,EAAE;MAAvB,gBACI,6BAAC,IAAD;QACI,IAAI,EAAEA,IADV;QAEI,UAAU,EAAEJ,sBAAA,CAAWC,MAAX,CAAkB,UAAlB;MAFhB,gBAII,6BAAC,YAAD;QAAO,KAAK,EAAEf,YAAY,CAACkB,IAAD,CAA1B;QAAkC,QAAQ,EAAE;MAA5C,EAJJ,CADJ,CADwB;IAAA,CAA3B,CADL,CA1BJ,eAuCI,6BAAC,UAAD,qBACI,6BAAC,UAAD;MAAM,IAAI,EAAE,EAAZ;MAAgB,SAAS,EAAEC;IAA3B,gBACI,6BAAC,qBAAD;MACI,eAAY,4BADhB;MAEI,OAAO,EAAE,iBAAAC,EAAE,EAAI;QACXP,MAAM,CAACO,EAAD,CAAN;MACH;IAJL,GAMK,cANL,CADJ,CADJ,CAvCJ,CADJ,CADH;EAAA,CANL,CADJ,CADJ;AAmEH,CA1ED;;eA4Eed,kB"}
|
|
@@ -0,0 +1,133 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
4
|
+
|
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
|
6
|
+
value: true
|
|
7
|
+
});
|
|
8
|
+
exports.default = void 0;
|
|
9
|
+
|
|
10
|
+
var _react = _interopRequireDefault(require("react"));
|
|
11
|
+
|
|
12
|
+
var _form = require("@webiny/form");
|
|
13
|
+
|
|
14
|
+
var _validation = require("@webiny/validation");
|
|
15
|
+
|
|
16
|
+
var _Button = require("@webiny/ui/Button");
|
|
17
|
+
|
|
18
|
+
var _Input = require("@webiny/ui/Input");
|
|
19
|
+
|
|
20
|
+
var _Grid = require("@webiny/ui/Grid");
|
|
21
|
+
|
|
22
|
+
var _Typography = require("@webiny/ui/Typography");
|
|
23
|
+
|
|
24
|
+
var _Elevation = require("@webiny/ui/Elevation");
|
|
25
|
+
|
|
26
|
+
var _Progress = require("@webiny/ui/Progress");
|
|
27
|
+
|
|
28
|
+
var _StateContainer = _interopRequireDefault(require("./StateContainer"));
|
|
29
|
+
|
|
30
|
+
var _StyledComponents = require("./StyledComponents");
|
|
31
|
+
|
|
32
|
+
var _useAuthenticator2 = require("@webiny/app-cognito-authenticator/hooks/useAuthenticator");
|
|
33
|
+
|
|
34
|
+
var _useSetNewPassword2 = require("@webiny/app-cognito-authenticator/hooks/useSetNewPassword");
|
|
35
|
+
|
|
36
|
+
var SetNewPassword = function SetNewPassword() {
|
|
37
|
+
var _useAuthenticator = (0, _useAuthenticator2.useAuthenticator)(),
|
|
38
|
+
changeState = _useAuthenticator.changeState;
|
|
39
|
+
|
|
40
|
+
var _useSetNewPassword = (0, _useSetNewPassword2.useSetNewPassword)(),
|
|
41
|
+
shouldRender = _useSetNewPassword.shouldRender,
|
|
42
|
+
setPassword = _useSetNewPassword.setPassword,
|
|
43
|
+
error = _useSetNewPassword.error,
|
|
44
|
+
loading = _useSetNewPassword.loading;
|
|
45
|
+
|
|
46
|
+
if (!shouldRender) {
|
|
47
|
+
return null;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
return /*#__PURE__*/_react.default.createElement(_StateContainer.default, null, /*#__PURE__*/_react.default.createElement(_form.Form, {
|
|
51
|
+
onSubmit: function onSubmit(data) {
|
|
52
|
+
/**
|
|
53
|
+
* We are positive that data is UseSetNewPasswordCallableParams
|
|
54
|
+
*/
|
|
55
|
+
return setPassword(data);
|
|
56
|
+
},
|
|
57
|
+
submitOnEnter: true
|
|
58
|
+
}, function (_ref) {
|
|
59
|
+
var Bind = _ref.Bind,
|
|
60
|
+
submit = _ref.submit,
|
|
61
|
+
data = _ref.data;
|
|
62
|
+
|
|
63
|
+
var retypePasswordValidator = function retypePasswordValidator(value) {
|
|
64
|
+
if (value !== data.password) {
|
|
65
|
+
throw Error("Passwords do not match!");
|
|
66
|
+
}
|
|
67
|
+
};
|
|
68
|
+
|
|
69
|
+
return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(_Elevation.Elevation, {
|
|
70
|
+
z: 2
|
|
71
|
+
}, /*#__PURE__*/_react.default.createElement(_StyledComponents.InnerContent, null, loading && /*#__PURE__*/_react.default.createElement(_Progress.CircularProgress, null), /*#__PURE__*/_react.default.createElement(_StyledComponents.Title, null, /*#__PURE__*/_react.default.createElement("h1", null, /*#__PURE__*/_react.default.createElement(_Typography.Typography, {
|
|
72
|
+
use: "headline4"
|
|
73
|
+
}, "Set New Password"))), error && /*#__PURE__*/_react.default.createElement(_Grid.Grid, null, /*#__PURE__*/_react.default.createElement(_Grid.Cell, {
|
|
74
|
+
span: 12,
|
|
75
|
+
className: _StyledComponents.errorMessage
|
|
76
|
+
}, error)), /*#__PURE__*/_react.default.createElement(_Grid.Grid, null, /*#__PURE__*/_react.default.createElement(_Grid.Cell, {
|
|
77
|
+
span: 12,
|
|
78
|
+
"data-testid": "password-reset-code"
|
|
79
|
+
}, /*#__PURE__*/_react.default.createElement(Bind, {
|
|
80
|
+
name: "code",
|
|
81
|
+
validators: _validation.validation.create("required")
|
|
82
|
+
}, /*#__PURE__*/_react.default.createElement(_Input.Input, {
|
|
83
|
+
autoComplete: "off",
|
|
84
|
+
label: "Password reset code",
|
|
85
|
+
outlined: true,
|
|
86
|
+
description: "Enter the code we sent to your email."
|
|
87
|
+
}))), /*#__PURE__*/_react.default.createElement(_Grid.Cell, {
|
|
88
|
+
span: 12,
|
|
89
|
+
"data-testid": "new-password-input"
|
|
90
|
+
}, /*#__PURE__*/_react.default.createElement(Bind, {
|
|
91
|
+
name: "password",
|
|
92
|
+
validators: _validation.validation.create("required")
|
|
93
|
+
}, /*#__PURE__*/_react.default.createElement(_Input.Input, {
|
|
94
|
+
autoComplete: "off",
|
|
95
|
+
type: "password",
|
|
96
|
+
label: "New password",
|
|
97
|
+
outlined: true,
|
|
98
|
+
description: "Enter your new password."
|
|
99
|
+
}))), /*#__PURE__*/_react.default.createElement(_Grid.Cell, {
|
|
100
|
+
span: 12,
|
|
101
|
+
"data-testid": "retype-password-input"
|
|
102
|
+
}, /*#__PURE__*/_react.default.createElement(Bind, {
|
|
103
|
+
name: "retypePassword",
|
|
104
|
+
validators: [_validation.validation.create("required"), retypePasswordValidator]
|
|
105
|
+
}, /*#__PURE__*/_react.default.createElement(_Input.Input, {
|
|
106
|
+
type: "password",
|
|
107
|
+
label: "Retype password",
|
|
108
|
+
outlined: true,
|
|
109
|
+
description: "Enter your new password once more."
|
|
110
|
+
}))), /*#__PURE__*/_react.default.createElement(_Grid.Cell, {
|
|
111
|
+
span: 12,
|
|
112
|
+
className: _StyledComponents.alignRight
|
|
113
|
+
}, /*#__PURE__*/_react.default.createElement(_Button.ButtonPrimary, {
|
|
114
|
+
"data-testid": "submit-btn-new-psw",
|
|
115
|
+
onClick: function onClick(ev) {
|
|
116
|
+
submit(ev);
|
|
117
|
+
}
|
|
118
|
+
}, "Set new password"))))), /*#__PURE__*/_react.default.createElement(_Grid.Grid, null, /*#__PURE__*/_react.default.createElement(_Grid.Cell, {
|
|
119
|
+
span: 12,
|
|
120
|
+
style: {
|
|
121
|
+
textAlign: "center"
|
|
122
|
+
}
|
|
123
|
+
}, "Want to sign in? ", /*#__PURE__*/_react.default.createElement("a", {
|
|
124
|
+
href: "#",
|
|
125
|
+
onClick: function onClick() {
|
|
126
|
+
return changeState("signIn");
|
|
127
|
+
}
|
|
128
|
+
}, "Sign in"))));
|
|
129
|
+
}));
|
|
130
|
+
};
|
|
131
|
+
|
|
132
|
+
var _default = SetNewPassword;
|
|
133
|
+
exports.default = _default;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["SetNewPassword","useAuthenticator","changeState","useSetNewPassword","shouldRender","setPassword","error","loading","data","Bind","submit","retypePasswordValidator","value","password","Error","errorMessage","validation","create","alignRight","ev","textAlign"],"sources":["SetNewPassword.tsx"],"sourcesContent":["import React from \"react\";\nimport { Form } from \"@webiny/form\";\nimport { validation } from \"@webiny/validation\";\nimport { ButtonPrimary } from \"@webiny/ui/Button\";\nimport { Input } from \"@webiny/ui/Input\";\nimport { Grid, Cell } from \"@webiny/ui/Grid\";\nimport { Typography } from \"@webiny/ui/Typography\";\nimport { Elevation } from \"@webiny/ui/Elevation\";\nimport { CircularProgress } from \"@webiny/ui/Progress\";\nimport StateContainer from \"./StateContainer\";\nimport { alignRight, InnerContent, Title, errorMessage } from \"./StyledComponents\";\nimport { useAuthenticator } from \"@webiny/app-cognito-authenticator/hooks/useAuthenticator\";\nimport {\n useSetNewPassword,\n UseSetNewPasswordCallableParams\n} from \"@webiny/app-cognito-authenticator/hooks/useSetNewPassword\";\n\nconst SetNewPassword: React.FC = () => {\n const { changeState } = useAuthenticator();\n const { shouldRender, setPassword, error, loading } = useSetNewPassword();\n\n if (!shouldRender) {\n return null;\n }\n\n return (\n <StateContainer>\n <Form\n onSubmit={data => {\n /**\n * We are positive that data is UseSetNewPasswordCallableParams\n */\n return setPassword(data as unknown as UseSetNewPasswordCallableParams);\n }}\n submitOnEnter\n >\n {({ Bind, submit, data }) => {\n const retypePasswordValidator = (value: string) => {\n if (value !== data.password) {\n throw Error(\"Passwords do not match!\");\n }\n };\n\n return (\n <>\n <Elevation z={2}>\n <InnerContent>\n {loading && <CircularProgress />}\n <Title>\n <h1>\n <Typography use=\"headline4\">\n Set New Password\n </Typography>\n </h1>\n </Title>\n\n {error && (\n <Grid>\n <Cell span={12} className={errorMessage}>\n {error}\n </Cell>\n </Grid>\n )}\n\n <Grid>\n <Cell span={12} data-testid=\"password-reset-code\">\n <Bind\n name=\"code\"\n validators={validation.create(\"required\")}\n >\n <Input\n autoComplete=\"off\"\n label={\"Password reset code\"}\n outlined={true}\n description={\n \"Enter the code we sent to your email.\"\n }\n />\n </Bind>\n </Cell>\n <Cell span={12} data-testid=\"new-password-input\">\n <Bind\n name=\"password\"\n validators={validation.create(\"required\")}\n >\n <Input\n autoComplete={\"off\"}\n type={\"password\"}\n label={\"New password\"}\n outlined={true}\n description={\"Enter your new password.\"}\n />\n </Bind>\n </Cell>\n <Cell span={12} data-testid=\"retype-password-input\">\n <Bind\n name=\"retypePassword\"\n validators={[\n validation.create(\"required\"),\n retypePasswordValidator\n ]}\n >\n <Input\n type={\"password\"}\n label={\"Retype password\"}\n outlined={true}\n description={\n \"Enter your new password once more.\"\n }\n />\n </Bind>\n </Cell>\n <Cell span={12} className={alignRight}>\n <ButtonPrimary\n data-testid=\"submit-btn-new-psw\"\n onClick={ev => {\n submit(ev);\n }}\n >\n {\"Set new password\"}\n </ButtonPrimary>\n </Cell>\n </Grid>\n </InnerContent>\n </Elevation>\n <Grid>\n <Cell span={12} style={{ textAlign: \"center\" }}>\n Want to sign in? {/* eslint-disable-next-line */}\n <a href={\"#\"} onClick={() => changeState(\"signIn\")}>\n Sign in\n </a>\n </Cell>\n </Grid>\n </>\n );\n }}\n </Form>\n </StateContainer>\n );\n};\n\nexport default SetNewPassword;\n"],"mappings":";;;;;;;;;AAAA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AAKA,IAAMA,cAAwB,GAAG,SAA3BA,cAA2B,GAAM;EACnC,wBAAwB,IAAAC,mCAAA,GAAxB;EAAA,IAAQC,WAAR,qBAAQA,WAAR;;EACA,yBAAsD,IAAAC,qCAAA,GAAtD;EAAA,IAAQC,YAAR,sBAAQA,YAAR;EAAA,IAAsBC,WAAtB,sBAAsBA,WAAtB;EAAA,IAAmCC,KAAnC,sBAAmCA,KAAnC;EAAA,IAA0CC,OAA1C,sBAA0CA,OAA1C;;EAEA,IAAI,CAACH,YAAL,EAAmB;IACf,OAAO,IAAP;EACH;;EAED,oBACI,6BAAC,uB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AAWC,MAAX,CAAkB,UAAlB;IAFhB,gBAII,6BAAC,YAAD;MACI,YAAY,EAAE,KADlB;MAEI,IAAI,EAAE,UAFV;MAGI,KAAK,EAAE,cAHX;MAII,QAAQ,EAAE,IAJd;MAKI,WAAW,EAAE;IALjB,EAJJ,CADJ,CAhBJ,eA8BI,6BAAC,UAAD;MAAM,IAAI,EAAE,EAAZ;MAAgB,eAAY;IAA5B,gBACI,6BAAC,IAAD;MACI,IAAI,EAAC,gBADT;MAEI,UAAU,EAAE,CACRD,sBAAA,CAAWC,MAAX,CAAkB,UAAlB,CADQ,EAERN,uBAFQ;IAFhB,gBAOI,6BAAC,YAAD;MACI,IAAI,EAAE,UADV;MAEI,KAAK,EAAE,iBAFX;MAGI,QAAQ,EAAE,IAHd;MAII,WAAW,EACP;IALR,EAPJ,CADJ,CA9BJ,eAgDI,6BAAC,UAAD;MAAM,IAAI,EAAE,EAAZ;MAAgB,SAAS,EAAEO;IAA3B,gBACI,6BAAC,qBAAD;MACI,eAAY,oBADhB;MAEI,OAAO,EAAE,iBAAAC,EAAE,EAAI;QACXT,MAAM,CAACS,EAAD,CAAN;MACH;IAJL,GAMK,kBANL,CADJ,CAhDJ,CAlBJ,CADJ,CADJ,eAiFI,6BAAC,UAAD,qBACI,6BAAC,UAAD;MAAM,IAAI,EAAE,EAAZ;MAAgB,KAAK,EAAE;QAAEC,SAAS,EAAE;MAAb;IAAvB,qCAEI;MAAG,IAAI,EAAE,GAAT;MAAc,OAAO,EAAE;QAAA,OAAMlB,WAAW,CAAC,QAAD,CAAjB;MAAA;IAAvB,aAFJ,CADJ,CAjFJ,CADJ;EA4FH,CA5GL,CADJ,CADJ;AAkHH,CA1HD;;eA4HeF,c"}
|
package/views/SignIn.js
ADDED
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
4
|
+
|
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
|
6
|
+
value: true
|
|
7
|
+
});
|
|
8
|
+
exports.default = void 0;
|
|
9
|
+
|
|
10
|
+
var _react = _interopRequireDefault(require("react"));
|
|
11
|
+
|
|
12
|
+
var _form = require("@webiny/form");
|
|
13
|
+
|
|
14
|
+
var _validation = require("@webiny/validation");
|
|
15
|
+
|
|
16
|
+
var _Button = require("@webiny/ui/Button");
|
|
17
|
+
|
|
18
|
+
var _Input = require("@webiny/ui/Input");
|
|
19
|
+
|
|
20
|
+
var _Grid = require("@webiny/ui/Grid");
|
|
21
|
+
|
|
22
|
+
var _Typography = require("@webiny/ui/Typography");
|
|
23
|
+
|
|
24
|
+
var _Elevation = require("@webiny/ui/Elevation");
|
|
25
|
+
|
|
26
|
+
var _Alert = require("@webiny/ui/Alert");
|
|
27
|
+
|
|
28
|
+
var _Progress = require("@webiny/ui/Progress");
|
|
29
|
+
|
|
30
|
+
var _useAuthenticator2 = require("@webiny/app-cognito-authenticator/hooks/useAuthenticator");
|
|
31
|
+
|
|
32
|
+
var _useSignIn2 = require("@webiny/app-cognito-authenticator/hooks/useSignIn");
|
|
33
|
+
|
|
34
|
+
var _StateContainer = _interopRequireDefault(require("./StateContainer"));
|
|
35
|
+
|
|
36
|
+
var _StyledComponents = require("./StyledComponents");
|
|
37
|
+
|
|
38
|
+
var SignIn = function SignIn() {
|
|
39
|
+
var _useAuthenticator = (0, _useAuthenticator2.useAuthenticator)(),
|
|
40
|
+
message = _useAuthenticator.message,
|
|
41
|
+
changeState = _useAuthenticator.changeState;
|
|
42
|
+
|
|
43
|
+
var _useSignIn = (0, _useSignIn2.useSignIn)(),
|
|
44
|
+
signIn = _useSignIn.signIn,
|
|
45
|
+
loading = _useSignIn.loading,
|
|
46
|
+
error = _useSignIn.error,
|
|
47
|
+
shouldRender = _useSignIn.shouldRender;
|
|
48
|
+
|
|
49
|
+
if (!shouldRender) {
|
|
50
|
+
return null;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
return /*#__PURE__*/_react.default.createElement(_StateContainer.default, null, /*#__PURE__*/_react.default.createElement(_form.Form, {
|
|
54
|
+
onSubmit: function onSubmit(data) {
|
|
55
|
+
/**
|
|
56
|
+
* We are positive that data is UseSignInCallableParams
|
|
57
|
+
*/
|
|
58
|
+
return signIn(data);
|
|
59
|
+
},
|
|
60
|
+
submitOnEnter: true
|
|
61
|
+
}, function (_ref) {
|
|
62
|
+
var Bind = _ref.Bind,
|
|
63
|
+
submit = _ref.submit;
|
|
64
|
+
return /*#__PURE__*/_react.default.createElement(_Elevation.Elevation, {
|
|
65
|
+
z: 2
|
|
66
|
+
}, /*#__PURE__*/_react.default.createElement(_StyledComponents.InnerContent, null, loading && /*#__PURE__*/_react.default.createElement(_Progress.CircularProgress, {
|
|
67
|
+
label: "Signing in..."
|
|
68
|
+
}), /*#__PURE__*/_react.default.createElement(_StyledComponents.Title, null, /*#__PURE__*/_react.default.createElement("h1", null, /*#__PURE__*/_react.default.createElement(_Typography.Typography, {
|
|
69
|
+
use: "headline4"
|
|
70
|
+
}, "Sign In"))), message && !error && /*#__PURE__*/_react.default.createElement(_Grid.Grid, null, /*#__PURE__*/_react.default.createElement(_Grid.Cell, {
|
|
71
|
+
span: 12
|
|
72
|
+
}, /*#__PURE__*/_react.default.createElement(_Alert.Alert, {
|
|
73
|
+
title: message.title,
|
|
74
|
+
type: message.type
|
|
75
|
+
}, message.text))), error && /*#__PURE__*/_react.default.createElement(_Grid.Grid, null, /*#__PURE__*/_react.default.createElement(_Grid.Cell, {
|
|
76
|
+
span: 12,
|
|
77
|
+
className: _StyledComponents.errorMessage
|
|
78
|
+
}, /*#__PURE__*/_react.default.createElement(_Alert.Alert, {
|
|
79
|
+
title: "Authentication error",
|
|
80
|
+
type: "danger"
|
|
81
|
+
}, error.message))), /*#__PURE__*/_react.default.createElement(_Grid.Grid, null, /*#__PURE__*/_react.default.createElement(_Grid.Cell, {
|
|
82
|
+
span: 12
|
|
83
|
+
}, /*#__PURE__*/_react.default.createElement(Bind, {
|
|
84
|
+
name: "username",
|
|
85
|
+
validators: _validation.validation.create("required,email"),
|
|
86
|
+
beforeChange: function beforeChange(val, cb) {
|
|
87
|
+
return cb(val.toLowerCase());
|
|
88
|
+
}
|
|
89
|
+
}, /*#__PURE__*/_react.default.createElement(_Input.Input, {
|
|
90
|
+
label: "Your e-mail"
|
|
91
|
+
}))), /*#__PURE__*/_react.default.createElement(_Grid.Cell, {
|
|
92
|
+
span: 12
|
|
93
|
+
}, /*#__PURE__*/_react.default.createElement(Bind, {
|
|
94
|
+
name: "password",
|
|
95
|
+
validators: _validation.validation.create("required")
|
|
96
|
+
}, /*#__PURE__*/_react.default.createElement(_Input.Input, {
|
|
97
|
+
type: "password",
|
|
98
|
+
label: "Your password"
|
|
99
|
+
}))), /*#__PURE__*/_react.default.createElement(_Grid.Cell, {
|
|
100
|
+
span: 12,
|
|
101
|
+
className: _StyledComponents.alignRight
|
|
102
|
+
}, /*#__PURE__*/_react.default.createElement(_Button.ButtonPrimary, {
|
|
103
|
+
"data-testid": "submit-sign-in-form-button",
|
|
104
|
+
onClick: function onClick(ev) {
|
|
105
|
+
submit(ev);
|
|
106
|
+
}
|
|
107
|
+
}, "Submit")), /*#__PURE__*/_react.default.createElement(_Grid.Cell, {
|
|
108
|
+
span: 12,
|
|
109
|
+
className: _StyledComponents.alignCenter
|
|
110
|
+
}, /*#__PURE__*/_react.default.createElement("a", {
|
|
111
|
+
href: "#",
|
|
112
|
+
onClick: function onClick() {
|
|
113
|
+
return changeState("forgotPassword");
|
|
114
|
+
}
|
|
115
|
+
}, "Forgot password?")))));
|
|
116
|
+
}));
|
|
117
|
+
};
|
|
118
|
+
|
|
119
|
+
var _default = SignIn;
|
|
120
|
+
exports.default = _default;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["SignIn","useAuthenticator","message","changeState","useSignIn","signIn","loading","error","shouldRender","data","Bind","submit","title","type","text","errorMessage","validation","create","val","cb","toLowerCase","alignRight","ev","alignCenter"],"sources":["SignIn.tsx"],"sourcesContent":["import React from \"react\";\nimport { Form } from \"@webiny/form\";\nimport { validation } from \"@webiny/validation\";\nimport { ButtonPrimary } from \"@webiny/ui/Button\";\nimport { Input } from \"@webiny/ui/Input\";\nimport { Grid, Cell } from \"@webiny/ui/Grid\";\nimport { Typography } from \"@webiny/ui/Typography\";\nimport { Elevation } from \"@webiny/ui/Elevation\";\nimport { Alert } from \"@webiny/ui/Alert\";\nimport { CircularProgress } from \"@webiny/ui/Progress\";\nimport { useAuthenticator } from \"@webiny/app-cognito-authenticator/hooks/useAuthenticator\";\nimport {\n useSignIn,\n UseSignInCallableParams\n} from \"@webiny/app-cognito-authenticator/hooks/useSignIn\";\nimport StateContainer from \"./StateContainer\";\nimport { alignRight, alignCenter, InnerContent, Title, errorMessage } from \"./StyledComponents\";\n\nconst SignIn: React.FC = () => {\n const { message, changeState } = useAuthenticator();\n const { signIn, loading, error, shouldRender } = useSignIn();\n\n if (!shouldRender) {\n return null;\n }\n\n return (\n <StateContainer>\n <Form\n onSubmit={data => {\n /**\n * We are positive that data is UseSignInCallableParams\n */\n return signIn(data as unknown as UseSignInCallableParams);\n }}\n submitOnEnter\n >\n {({ Bind, submit }) => (\n <Elevation z={2}>\n <InnerContent>\n {loading && <CircularProgress label={\"Signing in...\"} />}\n <Title>\n <h1>\n <Typography use=\"headline4\">Sign In</Typography>\n </h1>\n </Title>\n\n {message && !error && (\n <Grid>\n <Cell span={12}>\n <Alert title={message.title} type={message.type}>\n {message.text}\n </Alert>\n </Cell>\n </Grid>\n )}\n\n {error && (\n <Grid>\n <Cell span={12} className={errorMessage}>\n <Alert title=\"Authentication error\" type={\"danger\"}>\n {error.message}\n </Alert>\n </Cell>\n </Grid>\n )}\n\n <Grid>\n <Cell span={12}>\n <Bind\n name=\"username\"\n validators={validation.create(\"required,email\")}\n beforeChange={(val: string, cb: (value: string) => void) =>\n cb(val.toLowerCase())\n }\n >\n <Input label={\"Your e-mail\"} />\n </Bind>\n </Cell>\n <Cell span={12}>\n <Bind\n name=\"password\"\n validators={validation.create(\"required\")}\n >\n <Input type={\"password\"} label={\"Your password\"} />\n </Bind>\n </Cell>\n <Cell span={12} className={alignRight}>\n <ButtonPrimary\n data-testid=\"submit-sign-in-form-button\"\n onClick={ev => {\n submit(ev);\n }}\n >\n {\"Submit\"}\n </ButtonPrimary>\n </Cell>\n <Cell span={12} className={alignCenter}>\n <a href=\"#\" onClick={() => changeState(\"forgotPassword\")}>\n Forgot password?\n </a>\n </Cell>\n </Grid>\n </InnerContent>\n </Elevation>\n )}\n </Form>\n </StateContainer>\n );\n};\n\nexport default SignIn;\n"],"mappings":";;;;;;;;;AAAA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AAIA;;AACA;;AAEA,IAAMA,MAAgB,GAAG,SAAnBA,MAAmB,GAAM;EAC3B,wBAAiC,IAAAC,mCAAA,GAAjC;EAAA,IAAQC,OAAR,qBAAQA,OAAR;EAAA,IAAiBC,WAAjB,qBAAiBA,WAAjB;;EACA,iBAAiD,IAAAC,qBAAA,GAAjD;EAAA,IAAQC,MAAR,cAAQA,MAAR;EAAA,IAAgBC,OAAhB,cAAgBA,OAAhB;EAAA,IAAyBC,KAAzB,cAAyBA,KAAzB;EAAA,IAAgCC,YAAhC,cAAgCA,YAAhC;;EAEA,IAAI,CAACA,YAAL,EAAmB;IACf,OAAO,IAAP;EACH;;EAED,oBACI,6BAAC,uBAAD,qBACI,6BAAC,UAAD;IACI,QAAQ,EAAE,kBAAAC,IAAI,EAAI;MACd;AACpB;AACA;MACoB,OAAOJ,MAAM,CAACI,IAAD,CAAb;IACH,CANL;IAOI,aAAa;EAPjB,GASK;IAAA,IAAGC,IAAH,QAAGA,IAAH;IAAA,IAASC,MAAT,QAASA,MAAT;IAAA,oBACG,6BAAC,oBAAD;MAAW,CAAC,EAAE;IAAd,gBACI,6BAAC,8BAAD,QACKL,OAAO,iBAAI,6BAAC,0BAAD;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3B,gBACI,6BAAC,qBAAD;MACI,eAAY,4BADhB;MAEI,OAAO,EAAE,iBAAAC,EAAE,EAAI;QACXX,MAAM,CAACW,EAAD,CAAN;MACH;IAJL,GAMK,QANL,CADJ,CApBJ,eA8BI,6BAAC,UAAD;MAAM,IAAI,EAAE,EAAZ;MAAgB,SAAS,EAAEC;IAA3B,gBACI;MAAG,IAAI,EAAC,GAAR;MAAY,OAAO,EAAE;QAAA,OAAMpB,WAAW,CAAC,gBAAD,CAAjB;MAAA;IAArB,sBADJ,CA9BJ,CA5BJ,CADJ,CADH;EAAA,CATL,CADJ,CADJ;AAmFH,CA3FD;;eA6FeH,M"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
|
|
8
|
+
var _useSignedIn2 = require("@webiny/app-cognito-authenticator/hooks/useSignedIn");
|
|
9
|
+
|
|
10
|
+
var SignedIn = function SignedIn(_ref) {
|
|
11
|
+
var children = _ref.children;
|
|
12
|
+
|
|
13
|
+
var _useSignedIn = (0, _useSignedIn2.useSignedIn)(),
|
|
14
|
+
shouldRender = _useSignedIn.shouldRender;
|
|
15
|
+
|
|
16
|
+
return shouldRender ? children : null;
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
var _default = SignedIn;
|
|
20
|
+
exports.default = _default;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["SignedIn","children","useSignedIn","shouldRender"],"sources":["SignedIn.tsx"],"sourcesContent":["import React from \"react\";\nimport { useSignedIn } from \"@webiny/app-cognito-authenticator/hooks/useSignedIn\";\n\nconst SignedIn: React.FC = ({ children }) => {\n const { shouldRender } = useSignedIn();\n\n return shouldRender ? (children as unknown as React.ReactElement) : null;\n};\n\nexport default SignedIn;\n"],"mappings":";;;;;;;AACA;;AAEA,IAAMA,QAAkB,GAAG,SAArBA,QAAqB,OAAkB;EAAA,IAAfC,QAAe,QAAfA,QAAe;;EACzC,mBAAyB,IAAAC,yBAAA,GAAzB;EAAA,IAAQC,YAAR,gBAAQA,YAAR;;EAEA,OAAOA,YAAY,GAAIF,QAAJ,GAAiD,IAApE;AACH,CAJD;;eAMeD,Q"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard").default;
|
|
4
|
+
|
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
|
6
|
+
value: true
|
|
7
|
+
});
|
|
8
|
+
exports.default = void 0;
|
|
9
|
+
|
|
10
|
+
var React = _interopRequireWildcard(require("react"));
|
|
11
|
+
|
|
12
|
+
var _appAdmin = require("@webiny/app-admin");
|
|
13
|
+
|
|
14
|
+
var _StyledComponents = require("./StyledComponents");
|
|
15
|
+
|
|
16
|
+
var StateContainer = function StateContainer(_ref) {
|
|
17
|
+
var children = _ref.children;
|
|
18
|
+
return /*#__PURE__*/React.createElement(_StyledComponents.Wrapper, null, /*#__PURE__*/React.createElement(_StyledComponents.LogoWrapper, null, /*#__PURE__*/React.createElement(_appAdmin.Logo, null)), /*#__PURE__*/React.createElement(_StyledComponents.LoginContent, null, children));
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
var _default = StateContainer;
|
|
22
|
+
exports.default = _default;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["StateContainer","children"],"sources":["StateContainer.tsx"],"sourcesContent":["import * as React from \"react\";\nimport { Logo } from \"@webiny/app-admin\";\nimport { LoginContent, LogoWrapper, Wrapper } from \"./StyledComponents\";\n\nconst StateContainer: React.FC = ({ children }) => (\n <Wrapper>\n <LogoWrapper>\n <Logo />\n </LogoWrapper>\n <LoginContent>{children}</LoginContent>\n </Wrapper>\n);\n\nexport default StateContainer;\n"],"mappings":";;;;;;;;;AAAA;;AACA;;AACA;;AAEA,IAAMA,cAAwB,GAAG,SAA3BA,cAA2B;EAAA,IAAGC,QAAH,QAAGA,QAAH;EAAA,oBAC7B,oBAAC,yBAAD,qBACI,oBAAC,6BAAD,qBACI,oBAAC,cAAD,OADJ,CADJ,eAII,oBAAC,8BAAD,QAAeA,QAAf,CAJJ,CAD6B;AAAA,CAAjC;;eASeD,c"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
/// <reference types="web" />
|
|
3
|
+
/// <reference types="react" />
|
|
4
|
+
export declare const Wrapper: import("@emotion/styled-base").StyledComponent<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLElement>, HTMLElement>, Pick<import("react").ClassAttributes<HTMLElement> & import("react").HTMLAttributes<HTMLElement>, keyof import("react").HTMLAttributes<HTMLElement>>, object>;
|
|
5
|
+
export declare const LogoWrapper: import("@emotion/styled-base").StyledComponent<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, Pick<import("react").ClassAttributes<HTMLDivElement> & import("react").HTMLAttributes<HTMLDivElement>, keyof import("react").HTMLAttributes<HTMLDivElement>>, object>;
|
|
6
|
+
export declare const LoginContent: import("@emotion/styled-base").StyledComponent<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, Pick<import("react").ClassAttributes<HTMLDivElement> & import("react").HTMLAttributes<HTMLDivElement>, keyof import("react").HTMLAttributes<HTMLDivElement>>, object>;
|
|
7
|
+
export declare const InnerContent: import("@emotion/styled-base").StyledComponent<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, Pick<import("react").ClassAttributes<HTMLDivElement> & import("react").HTMLAttributes<HTMLDivElement>, keyof import("react").HTMLAttributes<HTMLDivElement>>, object>;
|
|
8
|
+
export declare const Footer: import("@emotion/styled-base").StyledComponent<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, Pick<import("react").ClassAttributes<HTMLDivElement> & import("react").HTMLAttributes<HTMLDivElement>, keyof import("react").HTMLAttributes<HTMLDivElement>>, object>;
|
|
9
|
+
export declare const Title: import("@emotion/styled-base").StyledComponent<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, Pick<import("react").ClassAttributes<HTMLDivElement> & import("react").HTMLAttributes<HTMLDivElement>, keyof import("react").HTMLAttributes<HTMLDivElement>>, object>;
|
|
10
|
+
export declare const alignRight: string;
|
|
11
|
+
export declare const alignCenter: string;
|
|
12
|
+
export declare const errorMessage: string;
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
4
|
+
|
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
|
6
|
+
value: true
|
|
7
|
+
});
|
|
8
|
+
exports.errorMessage = exports.alignRight = exports.alignCenter = exports.Wrapper = exports.Title = exports.LogoWrapper = exports.LoginContent = exports.InnerContent = exports.Footer = void 0;
|
|
9
|
+
|
|
10
|
+
var _styled = _interopRequireDefault(require("@emotion/styled"));
|
|
11
|
+
|
|
12
|
+
var _emotion = require("emotion");
|
|
13
|
+
|
|
14
|
+
var Wrapper = /*#__PURE__*/(0, _styled.default)("section", {
|
|
15
|
+
target: "exiqwj40",
|
|
16
|
+
label: "Wrapper"
|
|
17
|
+
})({
|
|
18
|
+
display: "flex",
|
|
19
|
+
flexDirection: "column",
|
|
20
|
+
justifyContent: "center",
|
|
21
|
+
minHeight: "100vh",
|
|
22
|
+
color: "var(--mdc-theme-on-surface)"
|
|
23
|
+
});
|
|
24
|
+
exports.Wrapper = Wrapper;
|
|
25
|
+
var LogoWrapper = /*#__PURE__*/(0, _styled.default)("div", {
|
|
26
|
+
target: "exiqwj41",
|
|
27
|
+
label: "LogoWrapper"
|
|
28
|
+
})({
|
|
29
|
+
margin: "0 auto",
|
|
30
|
+
marginBottom: 30
|
|
31
|
+
});
|
|
32
|
+
exports.LogoWrapper = LogoWrapper;
|
|
33
|
+
var LoginContent = /*#__PURE__*/(0, _styled.default)("div", {
|
|
34
|
+
target: "exiqwj42",
|
|
35
|
+
label: "LoginContent"
|
|
36
|
+
})({
|
|
37
|
+
width: "100%",
|
|
38
|
+
maxWidth: 500,
|
|
39
|
+
margin: "0 auto 25px auto",
|
|
40
|
+
".mdc-elevation--z2": {
|
|
41
|
+
borderRadius: 4,
|
|
42
|
+
boxShadow: "0 1px 3px 0 rgba(0,0,0,0.15)"
|
|
43
|
+
},
|
|
44
|
+
a: {
|
|
45
|
+
textDecoration: "none",
|
|
46
|
+
color: "var(--mdc-theme-primary)",
|
|
47
|
+
fontWeight: 600,
|
|
48
|
+
"&:hover": {
|
|
49
|
+
textDecoration: "underline"
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
});
|
|
53
|
+
exports.LoginContent = LoginContent;
|
|
54
|
+
var InnerContent = /*#__PURE__*/(0, _styled.default)("div", {
|
|
55
|
+
target: "exiqwj43",
|
|
56
|
+
label: "InnerContent"
|
|
57
|
+
})({
|
|
58
|
+
position: "relative",
|
|
59
|
+
padding: 25
|
|
60
|
+
});
|
|
61
|
+
exports.InnerContent = InnerContent;
|
|
62
|
+
var Footer = /*#__PURE__*/(0, _styled.default)("div", {
|
|
63
|
+
target: "exiqwj44",
|
|
64
|
+
label: "Footer"
|
|
65
|
+
})({
|
|
66
|
+
textAlign: "center",
|
|
67
|
+
marginBottom: 75,
|
|
68
|
+
a: {
|
|
69
|
+
textDecoration: "none",
|
|
70
|
+
color: "var(--mdc-theme-primary)"
|
|
71
|
+
}
|
|
72
|
+
});
|
|
73
|
+
exports.Footer = Footer;
|
|
74
|
+
var Title = /*#__PURE__*/(0, _styled.default)("div", {
|
|
75
|
+
target: "exiqwj45",
|
|
76
|
+
label: "Title"
|
|
77
|
+
})({
|
|
78
|
+
textAlign: "center",
|
|
79
|
+
margin: "10px 25px"
|
|
80
|
+
});
|
|
81
|
+
exports.Title = Title;
|
|
82
|
+
var alignRight = /*#__PURE__*/(0, _emotion.css)({
|
|
83
|
+
textAlign: "right"
|
|
84
|
+
}, "label:alignRight;");
|
|
85
|
+
exports.alignRight = alignRight;
|
|
86
|
+
var alignCenter = /*#__PURE__*/(0, _emotion.css)({
|
|
87
|
+
textAlign: "center"
|
|
88
|
+
}, "label:alignCenter;");
|
|
89
|
+
exports.alignCenter = alignCenter;
|
|
90
|
+
var errorMessage = /*#__PURE__*/(0, _emotion.css)({
|
|
91
|
+
color: "red"
|
|
92
|
+
}, "label:errorMessage;");
|
|
93
|
+
exports.errorMessage = errorMessage;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["Wrapper","styled","display","flexDirection","justifyContent","minHeight","color","LogoWrapper","margin","marginBottom","LoginContent","width","maxWidth","borderRadius","boxShadow","a","textDecoration","fontWeight","InnerContent","position","padding","Footer","textAlign","Title","alignRight","css","alignCenter","errorMessage"],"sources":["StyledComponents.ts"],"sourcesContent":["import styled from \"@emotion/styled\";\nimport { css } from \"emotion\";\n\nexport const Wrapper = styled(\"section\")({\n display: \"flex\",\n flexDirection: \"column\",\n justifyContent: \"center\",\n minHeight: \"100vh\",\n color: \"var(--mdc-theme-on-surface)\"\n});\n\nexport const LogoWrapper = styled(\"div\")({\n margin: \"0 auto\",\n marginBottom: 30\n});\n\nexport const LoginContent = styled(\"div\")({\n width: \"100%\",\n maxWidth: 500,\n margin: \"0 auto 25px auto\",\n \".mdc-elevation--z2\": {\n borderRadius: 4,\n boxShadow: \"0 1px 3px 0 rgba(0,0,0,0.15)\"\n },\n a: {\n textDecoration: \"none\",\n color: \"var(--mdc-theme-primary)\",\n fontWeight: 600,\n \"&:hover\": {\n textDecoration: \"underline\"\n }\n }\n});\n\nexport const InnerContent = styled(\"div\")({\n position: \"relative\",\n padding: 25\n});\n\nexport const Footer = styled(\"div\")({\n textAlign: \"center\",\n marginBottom: 75,\n a: {\n textDecoration: \"none\",\n color: \"var(--mdc-theme-primary)\"\n }\n});\n\nexport const Title = styled(\"div\")({\n textAlign: \"center\",\n margin: \"10px 25px\"\n});\n\nexport const alignRight = css({\n textAlign: \"right\"\n});\n\nexport const alignCenter = css({\n textAlign: \"center\"\n});\n\nexport const errorMessage = css({\n color: \"red\"\n});\n"],"mappings":";;;;;;;;;AAAA;;AACA;;AAEO,IAAMA,OAAO,oBAAGC,eAAH,EAAU,SAAV;EAAA;EAAA;AAAA,GAAqB;EACrCC,OAAO,EAAE,MAD4B;EAErCC,aAAa,EAAE,QAFsB;EAGrCC,cAAc,EAAE,QAHqB;EAIrCC,SAAS,EAAE,OAJ0B;EAKrCC,KAAK,EAAE;AAL8B,CAArB,CAAb;;AAQA,IAAMC,WAAW,oBAAGN,eAAH,EAAU,KAAV;EAAA;EAAA;AAAA,GAAiB;EACrCO,MAAM,EAAE,QAD6B;EAErCC,YAAY,EAAE;AAFuB,CAAjB,CAAjB;;AAKA,IAAMC,YAAY,oBAAGT,eAAH,EAAU,KAAV;EAAA;EAAA;AAAA,GAAiB;EACtCU,KAAK,EAAE,MAD+B;EAEtCC,QAAQ,EAAE,GAF4B;EAGtCJ,MAAM,EAAE,kBAH8B;EAItC,sBAAsB;IAClBK,YAAY,EAAE,CADI;IAElBC,SAAS,EAAE;EAFO,CAJgB;EAQtCC,CAAC,EAAE;IACCC,cAAc,EAAE,MADjB;IAECV,KAAK,EAAE,0BAFR;IAGCW,UAAU,EAAE,GAHb;IAIC,WAAW;MACPD,cAAc,EAAE;IADT;EAJZ;AARmC,CAAjB,CAAlB;;AAkBA,IAAME,YAAY,oBAAGjB,eAAH,EAAU,KAAV;EAAA;EAAA;AAAA,GAAiB;EACtCkB,QAAQ,EAAE,UAD4B;EAEtCC,OAAO,EAAE;AAF6B,CAAjB,CAAlB;;AAKA,IAAMC,MAAM,oBAAGpB,eAAH,EAAU,KAAV;EAAA;EAAA;AAAA,GAAiB;EAChCqB,SAAS,EAAE,QADqB;EAEhCb,YAAY,EAAE,EAFkB;EAGhCM,CAAC,EAAE;IACCC,cAAc,EAAE,MADjB;IAECV,KAAK,EAAE;EAFR;AAH6B,CAAjB,CAAZ;;AASA,IAAMiB,KAAK,oBAAGtB,eAAH,EAAU,KAAV;EAAA;EAAA;AAAA,GAAiB;EAC/BqB,SAAS,EAAE,QADoB;EAE/Bd,MAAM,EAAE;AAFuB,CAAjB,CAAX;;AAKA,IAAMgB,UAAU,gBAAG,IAAAC,YAAA,EAAI;EAC1BH,SAAS,EAAE;AADe,CAAJ,sBAAnB;;AAIA,IAAMI,WAAW,gBAAG,IAAAD,YAAA,EAAI;EAC3BH,SAAS,EAAE;AADgB,CAAJ,uBAApB;;AAIA,IAAMK,YAAY,gBAAG,IAAAF,YAAA,EAAI;EAC5BnB,KAAK,EAAE;AADqB,CAAJ,wBAArB"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
+
<svg width="413px" height="136px" viewBox="0 0 413 136" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
|
|
3
|
+
<!-- Generator: Sketch 55.2 (78181) - https://sketchapp.com -->
|
|
4
|
+
<title>Logo</title>
|
|
5
|
+
<desc>Created with Sketch.</desc>
|
|
6
|
+
<defs>
|
|
7
|
+
<path d="M113.8653,106.64105 L67.5565,133.37785 C63.1738,135.90765 57.7745,135.90765 53.3919,133.37785 L7.0822,106.64105 C2.6996,104.11045 -4.91085111e-15,99.43505 -4.60099098e-15,94.37465 L-1.32667732e-15,40.90105 C-1.01681719e-15,35.84065 2.6996,31.16455 7.0822,28.63475 L53.3919,1.89795 C57.7745,-0.63265 63.1738,-0.63265 67.5565,1.89795 L113.8653,28.63475 C118.248,31.16455 120.9476,35.84065 120.9476,40.90105 L120.9476,94.37465 C120.9476,99.43505 118.248,104.11045 113.8653,106.64105 Z M88.4639,45.0833 C84.9908,54.8825 81.4929,64.7065 77.9959,74.5412 L76.886,74.5412 C73.4006,64.6826 69.9035,54.8347 66.4181,45 L55.5444,45 C52.0111,54.9427 48.5141,64.7897 45.0171,74.6492 L44.002,74.6492 C40.4572,64.6941 36.9124,54.7398 33.4862,45.1311 L20.5,45.1311 C26.8146,63.214 32.9734,80.8434 39.1321,98.4728 L49.8507,98.4728 L60.4622,68.6446 L61.5366,68.6446 C65.0814,78.6475 68.6147,88.662 72.0878,98.4488 L82.8304,98.4488 C89.013,80.7477 95.1718,63.1068 101.4625,45.0833 L88.4639,45.0833 Z" id="path-1"></path>
|
|
8
|
+
</defs>
|
|
9
|
+
<g id="Page-3" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
|
|
10
|
+
<g id="Webiny-Logo-Icon" transform="translate(-95.000000, -227.000000)">
|
|
11
|
+
<g id="Logo" transform="translate(95.000000, 226.598492)">
|
|
12
|
+
<path d="M266.606118,87.28355 L266.606118,96.05205 L306.300318,96.05205 L306.300318,87.28355 L266.606118,87.28355 Z M306.344818,184.06705 L306.344818,174.89865 C298.508918,174.89865 291.063818,174.91595 283.618718,174.88955 C278.670418,174.86315 275.188318,171.34475 275.232818,166.50285 C275.268318,161.61645 277.746918,159.35135 283.255118,159.31585 C289.766718,159.27135 296.287518,159.31585 302.799918,159.28945 C303.981618,159.28045 305.163218,159.08495 306.291218,158.97865 L306.291218,150.41375 C305.935818,150.26285 305.749418,150.11195 305.562318,150.11195 C296.261118,150.08555 286.941718,149.93385 277.639718,150.11195 C273.109518,150.20105 269.564718,152.33255 267.663218,156.80175 C270.710818,161.37645 270.443718,166.44095 269.821918,171.51375 C269.306618,175.65395 269.591118,179.70425 270.488218,184.15535 C282.481618,184.11985 294.386818,184.25345 306.344818,184.06705 L306.344818,184.06705 Z M296.980918,141.51245 C300.836618,141.40525 303.670718,138.93565 305.305018,135.39085 C306.992918,131.73055 307.721818,127.83035 306.797518,123.92185 C306.033118,120.68785 304.638718,117.60475 303.483518,114.36255 C304.700618,112.95835 306.086718,111.35045 307.623718,109.59155 C305.651318,107.39735 303.954418,105.49595 302.258218,103.60355 C297.176418,107.65465 297.176418,107.65465 290.557518,107.65465 C283.734218,107.65465 276.902618,107.65465 270.080018,107.66375 C268.978418,107.66375 267.867718,107.76185 266.623418,107.82375 L266.623418,116.86765 L288.860518,116.86765 C293.693418,116.86765 296.936418,119.39085 298.153518,124.09915 C299.575018,129.60725 297.398218,132.48585 291.730018,132.50405 C284.498518,132.53045 277.258018,132.50405 270.017418,132.52135 C268.915718,132.52135 267.814118,132.62775 266.695218,132.69035 L266.695218,141.59245 C276.947118,141.59245 286.968118,141.76975 296.980918,141.51245 L296.980918,141.51245 Z M298.615218,22.89265 C298.313418,27.28095 296.536518,28.97795 292.085418,28.67535 C287.617118,24.23335 289.509518,18.71695 289.206918,13.51965 C294.724118,13.89235 298.935218,18.21895 298.615218,22.89265 L298.615218,22.89265 Z M278.475018,35.66775 C277.497918,33.41995 276.591718,31.45665 275.800918,29.44875 C274.548418,26.30385 274.183918,23.04355 274.859318,19.70315 C275.525518,16.38015 277.116118,14.78125 280.624718,14.15045 C280.624718,16.04285 280.633818,17.87265 280.624718,19.69405 C280.581018,23.99425 281.184618,28.16905 283.227918,32.00745 C287.412618,39.85165 298.242518,40.82045 303.430718,33.72175 C308.938918,26.19665 308.468118,14.96765 300.729418,8.46425 C294.928618,3.59595 288.140718,2.64525 280.873718,3.80955 C274.939318,4.76845 270.452718,7.83345 267.778718,13.17335 C263.976518,20.76025 265.993518,33.50895 271.980718,40.13605 C274.131218,38.65265 276.307218,37.15115 278.475018,35.66775 L278.475018,35.66775 Z M283.272418,203.75375 C289.118618,201.22155 293.018018,194.18545 292.111818,187.73565 C292.031818,187.15845 291.668218,186.62575 291.383718,185.96775 L282.339818,185.96775 C282.535218,187.18485 282.775218,188.18915 282.837018,189.20175 C282.997018,191.74225 281.619918,194.22995 279.639318,195.13615 C277.417918,196.15785 274.246618,195.57155 272.531518,193.61735 C271.669818,192.63115 270.799118,191.45855 270.470918,190.22335 C269.680118,187.25575 268.826718,184.21795 268.703018,181.17035 C268.463018,175.60035 268.826718,170.00315 268.658518,164.42405 C268.515818,159.91125 266.206218,155.66465 262.350518,153.31875 C255.651618,149.25025 246.359518,151.15995 241.845818,157.30805 C237.466518,163.27795 238.248218,172.18005 243.685418,177.46555 C247.603018,181.27755 252.489418,182.92095 258.103918,183.78265 L258.103918,174.46325 C257.091418,174.14335 255.891618,173.85885 254.763618,173.39715 C253.528418,172.89085 252.267618,172.36635 251.174218,171.62015 C248.473718,169.77225 247.585718,166.45005 248.891018,163.68695 C249.921718,161.50095 252.915718,160.06205 255.429818,160.54195 C258.512918,161.12825 259.605518,162.70985 259.614518,166.72545 C259.631918,172.41095 259.436418,178.09635 259.623618,183.77355 C259.819018,189.45975 261.453318,194.77175 265.042718,199.31185 C269.271118,204.66905 276.928918,206.49875 283.272418,203.75375 L283.272418,203.75375 Z M278.448618,69.76465 C275.330118,67.39235 274.530318,64.05205 274.548418,60.41815 C274.557518,58.66835 274.832918,56.91785 275.028318,54.65275 C281.238218,54.65275 287.226218,54.42185 293.187118,54.75085 C296.145618,54.90995 297.789018,57.48675 298.553418,60.16085 C299.450518,63.27945 299.192418,66.34435 296.651918,68.78755 C292.307218,72.94505 283.255118,73.41585 278.448618,69.76465 L278.448618,69.76465 Z M291.863618,81.19825 C302.133718,79.71485 308.308118,71.94075 307.703718,61.64425 C307.570118,59.41465 306.851118,57.22045 306.317618,54.63455 L323.117418,54.63455 L323.117418,45.24435 L268.045018,45.24435 C266.579718,49.45545 265.513518,57.99305 265.859918,62.26605 C266.686118,72.48325 271.847918,78.95045 281.415518,80.94915 C284.783018,81.65995 288.451518,81.69545 291.863618,81.19825 L291.863618,81.19825 Z M306.309318,-6.53145 C299.015218,-9.11735 291.703718,-11.71965 284.383118,-14.32285 L284.383118,-15.14905 C291.721018,-17.74325 299.050618,-20.34635 306.371218,-22.94045 L306.371218,-31.03365 C298.970618,-33.66405 291.641018,-36.26645 284.303118,-38.86965 L284.303118,-39.62495 C291.712718,-42.26355 299.121518,-44.90215 306.273118,-47.45175 L306.273118,-57.11745 C292.814418,-52.41815 279.692118,-47.83355 266.570718,-43.24975 L266.570718,-35.27195 L288.771518,-27.37345 L288.771518,-26.57435 C281.327218,-23.93575 273.873118,-21.30615 266.588018,-18.72035 L266.588018,-10.72525 C279.763018,-6.12335 292.894318,-1.53865 306.309318,3.14325 L306.309318,-6.53145 Z" id="Fill-15" fill="#FA5A28" transform="translate(281.068188, 73.950738) rotate(-90.000000) translate(-281.068188, -73.950738) "></path>
|
|
13
|
+
<g id="Webiny-Icon-Orange" transform="translate(-0.000000, 0.901508)">
|
|
14
|
+
<mask id="mask-2" fill="white">
|
|
15
|
+
<use xlink:href="#path-1"></use>
|
|
16
|
+
</mask>
|
|
17
|
+
<use id="Mask" fill="#FA5A28" fill-rule="evenodd" xlink:href="#path-1"></use>
|
|
18
|
+
<g id="Orange" mask="url(#mask-2)"></g>
|
|
19
|
+
</g>
|
|
20
|
+
</g>
|
|
21
|
+
</g>
|
|
22
|
+
</g>
|
|
23
|
+
</svg>
|