@webiny/app-admin-cognito 5.27.0 → 5.29.0-beta.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.
package/index.js CHANGED
@@ -1,37 +1,69 @@
1
- import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
2
- import _objectSpread from "@babel/runtime/helpers/objectSpread2";
3
- import _asyncToGenerator from "@babel/runtime/helpers/asyncToGenerator";
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
+
4
52
  var _excluded = ["getIdentityData", "onError"],
5
53
  _excluded2 = ["id", "displayName", "type", "permissions"];
6
- import _regeneratorRuntime from "@babel/runtime/regenerator";
7
- import React, { useCallback, useEffect } from "react";
8
- import { Auth } from "@aws-amplify/auth";
9
- import { useApolloClient } from "@apollo/react-hooks";
10
- import { setContext } from "apollo-link-context";
11
- import { plugins } from "@webiny/plugins";
12
- import { ApolloLinkPlugin } from "@webiny/app/plugins/ApolloLinkPlugin";
13
- import { Authenticator } from "@webiny/app-cognito-authenticator/Authenticator";
14
- import CheckingUser from "./views/CheckingUser";
15
- import SignIn from "./views/SignIn";
16
- import RequireNewPassword from "./views/RequireNewPassword";
17
- import ForgotPassword from "./views/ForgotPassword";
18
- import SetNewPassword from "./views/SetNewPassword";
19
- import SignedIn from "./views/SignedIn";
20
- import { useSecurity } from "@webiny/app-security";
21
- import { config as appConfig } from "@webiny/app/config";
22
54
 
23
55
  var createApolloLinkPlugin = function createApolloLinkPlugin() {
24
- return new ApolloLinkPlugin(function () {
25
- return setContext( /*#__PURE__*/function () {
26
- var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(_, _ref) {
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) {
27
59
  var headers, user, idToken;
28
- return _regeneratorRuntime.wrap(function _callee$(_context) {
60
+ return (0, _regeneratorRuntime2.default)().wrap(function _callee$(_context) {
29
61
  while (1) {
30
62
  switch (_context.prev = _context.next) {
31
63
  case 0:
32
64
  headers = _ref.headers;
33
65
  _context.next = 3;
34
- return Auth.currentSession();
66
+ return _auth.Auth.currentSession();
35
67
 
36
68
  case 3:
37
69
  user = _context.sent;
@@ -58,7 +90,7 @@ var createApolloLinkPlugin = function createApolloLinkPlugin() {
58
90
 
59
91
  case 9:
60
92
  return _context.abrupt("return", {
61
- headers: _objectSpread(_objectSpread({}, headers), {}, {
93
+ headers: (0, _objectSpread2.default)((0, _objectSpread2.default)({}, headers), {}, {
62
94
  Authorization: "Bearer ".concat(idToken.getJwtToken())
63
95
  })
64
96
  });
@@ -79,14 +111,15 @@ var createApolloLinkPlugin = function createApolloLinkPlugin() {
79
111
  };
80
112
 
81
113
  var defaultOptions = {
82
- region: appConfig.getKey("USER_POOL_REGION", process.env.REACT_APP_USER_POOL_REGION),
83
- userPoolId: appConfig.getKey("USER_POOL_ID", process.env.REACT_APP_USER_POOL_ID),
84
- userPoolWebClientId: appConfig.getKey("USER_POOL_WEB_CLIENT_ID", process.env.REACT_APP_USER_POOL_WEB_CLIENT_ID)
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)
85
117
  };
86
- export var createAuthentication = function createAuthentication(_ref3) {
118
+
119
+ var createAuthentication = function createAuthentication(_ref3) {
87
120
  var getIdentityData = _ref3.getIdentityData,
88
121
  onError = _ref3.onError,
89
- config = _objectWithoutProperties(_ref3, _excluded);
122
+ config = (0, _objectWithoutProperties2.default)(_ref3, _excluded);
90
123
 
91
124
  /**
92
125
  * TODO @ts-refactor
@@ -95,39 +128,46 @@ export var createAuthentication = function createAuthentication(_ref3) {
95
128
  Object.keys(config).forEach(function (key) {
96
129
  return config[key] === undefined && delete config[key];
97
130
  });
98
- Auth.configure(_objectSpread(_objectSpread({}, defaultOptions), config));
131
+
132
+ _auth.Auth.configure((0, _objectSpread2.default)((0, _objectSpread2.default)({}, defaultOptions), config));
99
133
 
100
134
  var Authentication = function Authentication(props) {
101
135
  var children = props.children;
102
136
 
103
- var _useSecurity = useSecurity(),
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)(),
104
143
  setIdentity = _useSecurity.setIdentity;
105
144
 
106
- var client = useApolloClient();
107
- var onToken = useCallback( /*#__PURE__*/function () {
108
- var _ref4 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee2(token) {
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) {
109
148
  var payload, logout, _yield$getIdentityDat, id, displayName, type, permissions, data;
110
149
 
111
- return _regeneratorRuntime.wrap(function _callee2$(_context2) {
150
+ return (0, _regeneratorRuntime2.default)().wrap(function _callee2$(_context2) {
112
151
  while (1) {
113
152
  switch (_context2.prev = _context2.next) {
114
153
  case 0:
115
154
  payload = token.payload, logout = token.logout;
116
- _context2.prev = 1;
117
- _context2.next = 4;
155
+ setLoadingIdentity(true);
156
+ _context2.prev = 2;
157
+ _context2.next = 5;
118
158
  return getIdentityData({
119
159
  client: client,
120
160
  payload: payload
121
161
  });
122
162
 
123
- case 4:
163
+ case 5:
124
164
  _yield$getIdentityDat = _context2.sent;
125
165
  id = _yield$getIdentityDat.id;
126
166
  displayName = _yield$getIdentityDat.displayName;
127
167
  type = _yield$getIdentityDat.type;
128
168
  permissions = _yield$getIdentityDat.permissions;
129
- data = _objectWithoutProperties(_yield$getIdentityDat, _excluded2);
130
- setIdentity(_objectSpread(_objectSpread({
169
+ data = (0, _objectWithoutProperties2.default)(_yield$getIdentityDat, _excluded2);
170
+ setIdentity((0, _objectSpread2.default)((0, _objectSpread2.default)({
131
171
  id: id,
132
172
  displayName: displayName,
133
173
  type: type,
@@ -137,12 +177,12 @@ export var createAuthentication = function createAuthentication(_ref3) {
137
177
  return void 0;
138
178
  }
139
179
  }));
140
- _context2.next = 17;
180
+ _context2.next = 18;
141
181
  break;
142
182
 
143
- case 13:
144
- _context2.prev = 13;
145
- _context2.t0 = _context2["catch"](1);
183
+ case 14:
184
+ _context2.prev = 14;
185
+ _context2.t0 = _context2["catch"](2);
146
186
  console.log("ERROR", _context2.t0);
147
187
 
148
188
  if (typeof onError === "function") {
@@ -151,25 +191,32 @@ export var createAuthentication = function createAuthentication(_ref3) {
151
191
  console.error(_context2.t0);
152
192
  }
153
193
 
154
- case 17:
194
+ case 18:
195
+ _context2.prev = 18;
196
+ setLoadingIdentity(false);
197
+ return _context2.finish(18);
198
+
199
+ case 21:
155
200
  case "end":
156
201
  return _context2.stop();
157
202
  }
158
203
  }
159
- }, _callee2, null, [[1, 13]]);
204
+ }, _callee2, null, [[2, 14, 18, 21]]);
160
205
  }));
161
206
 
162
207
  return function (_x3) {
163
208
  return _ref4.apply(this, arguments);
164
209
  };
165
210
  }(), []);
166
- useEffect(function () {
167
- plugins.register(createApolloLinkPlugin());
211
+ (0, _react.useEffect)(function () {
212
+ _plugins.plugins.register(createApolloLinkPlugin());
168
213
  }, []);
169
- return /*#__PURE__*/React.createElement(Authenticator, {
214
+ return /*#__PURE__*/_react.default.createElement(_Authenticator.Authenticator, {
170
215
  onToken: onToken
171
- }, /*#__PURE__*/React.createElement(CheckingUser, null), /*#__PURE__*/React.createElement(SignIn, null), /*#__PURE__*/React.createElement(RequireNewPassword, null), /*#__PURE__*/React.createElement(ForgotPassword, null), /*#__PURE__*/React.createElement(SetNewPassword, null), /*#__PURE__*/React.createElement(SignedIn, null, children));
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));
172
217
  };
173
218
 
174
219
  return Authentication;
175
- };
220
+ };
221
+
222
+ exports.createAuthentication = createAuthentication;
package/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["index.tsx"],"names":["React","useCallback","useEffect","Auth","useApolloClient","setContext","plugins","ApolloLinkPlugin","Authenticator","CheckingUser","SignIn","RequireNewPassword","ForgotPassword","SetNewPassword","SignedIn","useSecurity","config","appConfig","createApolloLinkPlugin","_","headers","currentSession","user","idToken","getIdToken","Authorization","getJwtToken","defaultOptions","region","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","Object","keys","forEach","key","undefined","configure","Authentication","props","children","setIdentity","client","onToken","token","payload","logout","id","displayName","type","permissions","data","console","log","error","register"],"mappings":";;;;;;AAAA,OAAOA,KAAP,IAAgBC,WAAhB,EAA6BC,SAA7B,QAA8C,OAA9C;AACA,SAASC,IAAT,QAAqB,mBAArB;AAGA,SAASC,eAAT,QAAgC,qBAAhC;AACA,SAASC,UAAT,QAA2B,qBAA3B;AACA,SAASC,OAAT,QAAwB,iBAAxB;AACA,SAASC,gBAAT,QAAiC,sCAAjC;AAEA,SAASC,aAAT,QAA8B,iDAA9B;AACA,OAAOC,YAAP;AACA,OAAOC,MAAP;AACA,OAAOC,kBAAP;AACA,OAAOC,cAAP;AACA,OAAOC,cAAP;AACA,OAAOC,QAAP;AACA,SAASC,WAAT,QAA4B,sBAA5B;AACA,SAASC,MAAM,IAAIC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AXA;AAJO,mBAKJC,IALI;AAMPL,kBAAAA,MAAM,EACFA,MAAM,IACL,YAAM;AACH,2BAAO,KAAK,CAAZ;AACH;AAVE,mBAAX;AAToB;AAAA;;AAAA;AAAA;AAAA;AAsBpBM,gBAAAA,OAAO,CAACC,GAAR,CAAY,OAAZ;;AACA,oBAAI,OAAOtB,OAAP,KAAmB,UAAvB,EAAmC;AAC/BA,kBAAAA,OAAO,cAAP;AACH,iBAFD,MAEO;AACHqB,kBAAAA,OAAO,CAACE,KAAR;AACH;;AA3BmB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,OAAD;;AAAA;AAAA;AAAA;AAAA,SA6BxB,EA7BwB,CAA3B;AA+BA5D,IAAAA,SAAS,CAAC,YAAM;AACZI,MAAAA,OAAO,CAACyD,QAAR,CAAiB7C,sBAAsB,EAAvC;AACH,KAFQ,EAEN,EAFM,CAAT;AAIA,wBACI,oBAAC,aAAD;AAAe,MAAA,OAAO,EAAEiC;AAAxB,oBACI,oBAAC,YAAD,OADJ,eAEI,oBAAC,MAAD,OAFJ,eAGI,oBAAC,kBAAD,OAHJ,eAII,oBAAC,cAAD,OAJJ,eAKI,oBAAC,cAAD,OALJ,eAMI,oBAAC,QAAD,QAAWH,QAAX,CANJ,CADJ;AAUH,GAlDD;;AAoDA,SAAOF,cAAP;AACH,CAjEM","sourcesContent":["import React, { useCallback, useEffect } 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 CheckingUser from \"~/views/CheckingUser\";\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\";\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 { setIdentity } = useSecurity();\n const client = useApolloClient();\n\n const onToken = useCallback(async (token: CognitoIdToken) => {\n const { payload, logout } = token;\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 }\n }, []);\n\n useEffect(() => {\n plugins.register(createApolloLinkPlugin());\n }, []);\n\n return (\n <Authenticator onToken={onToken}>\n <CheckingUser />\n <SignIn />\n <RequireNewPassword />\n <ForgotPassword />\n <SetNewPassword />\n <SignedIn>{children}</SignedIn>\n </Authenticator>\n );\n };\n\n return Authentication;\n};\n"]}
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;oBAEH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,eAAe,gBAAG,6BAAC,kBAAD,OAAH,gBAAmB,6BAAC,eAAD,OADvC,eAEI,6BAAC,2BAAD,OAFJ,eAGI,6BAAC,uBAAD,OAHJ,eAII,6BAAC,uBAAD,OAJJ,eAKI,6BAAC,iBAAD,QAAWF,QAAX,CALJ,CADJ;EASH,CAtDD;;EAwDA,OAAOF,cAAP;AACH,CArEM"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@webiny/app-admin-cognito",
3
- "version": "5.27.0",
3
+ "version": "5.29.0-beta.0",
4
4
  "main": "index.js",
5
5
  "repository": {
6
6
  "type": "git",
@@ -13,16 +13,16 @@
13
13
  "license": "MIT",
14
14
  "dependencies": {
15
15
  "@apollo/react-hooks": "3.1.5",
16
- "@aws-amplify/auth": "4.4.0",
16
+ "@aws-amplify/auth": "4.5.8",
17
17
  "@emotion/styled": "10.3.0",
18
- "@webiny/app": "5.27.0",
19
- "@webiny/app-admin": "5.27.0",
20
- "@webiny/app-cognito-authenticator": "5.27.0",
21
- "@webiny/app-security": "5.27.0",
22
- "@webiny/form": "5.27.0",
23
- "@webiny/plugins": "5.27.0",
24
- "@webiny/ui": "5.27.0",
25
- "@webiny/validation": "5.27.0",
18
+ "@webiny/app": "5.29.0-beta.0",
19
+ "@webiny/app-admin": "5.29.0-beta.0",
20
+ "@webiny/app-cognito-authenticator": "5.29.0-beta.0",
21
+ "@webiny/app-security": "5.29.0-beta.0",
22
+ "@webiny/form": "5.29.0-beta.0",
23
+ "@webiny/plugins": "5.29.0-beta.0",
24
+ "@webiny/ui": "5.29.0-beta.0",
25
+ "@webiny/validation": "5.29.0-beta.0",
26
26
  "apollo-client": "2.6.10",
27
27
  "apollo-link-context": "1.0.20",
28
28
  "emotion": "10.0.27",
@@ -37,8 +37,8 @@
37
37
  "@babel/preset-env": "^7.16.4",
38
38
  "@babel/preset-react": "^7.16.0",
39
39
  "@babel/preset-typescript": "^7.16.0",
40
- "@webiny/cli": "^5.27.0",
41
- "@webiny/project-utils": "^5.27.0",
40
+ "@webiny/cli": "^5.29.0-beta.0",
41
+ "@webiny/project-utils": "^5.29.0-beta.0",
42
42
  "babel-plugin-lodash": "^3.3.4",
43
43
  "rimraf": "^3.0.2",
44
44
  "ttypescript": "^1.5.12",
@@ -59,5 +59,5 @@
59
59
  ]
60
60
  }
61
61
  },
62
- "gitHead": "0f2b0b65639d2e1a79cf9189c8fe5cea2c32d302"
62
+ "gitHead": "e221dc575942c512548be142e20c5bd1231edcda"
63
63
  }
package/types.js CHANGED
@@ -0,0 +1 @@
1
+ "use strict";
package/types.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":[],"names":[],"mappings":"","sourcesContent":[]}
1
+ {"version":3,"names":[],"sources":["types.ts"],"sourcesContent":[""],"mappings":""}
@@ -1,25 +1,48 @@
1
- import * as React from "react";
2
- import { Form } from "@webiny/form";
3
- import { validation } from "@webiny/validation";
4
- import { ButtonPrimary, ButtonDefault } from "@webiny/ui/Button";
5
- import { Input } from "@webiny/ui/Input";
6
- import { Grid, Cell } from "@webiny/ui/Grid";
7
- import { Typography } from "@webiny/ui/Typography";
8
- import { Alert } from "@webiny/ui/Alert";
9
- import { Elevation } from "@webiny/ui/Elevation";
10
- import StateContainer from "./StateContainer";
11
- import { alignRight, InnerContent, Title } from "./StyledComponents";
12
- import { CircularProgress } from "@webiny/ui/Progress";
13
- import { useAuthenticator } from "@webiny/app-cognito-authenticator/hooks/useAuthenticator";
14
- import { useForgotPassword } from "@webiny/app-cognito-authenticator/hooks/useForgotPassword";
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");
15
39
 
16
40
  var ForgotPassword = function ForgotPassword() {
17
- var _useAuthenticator = useAuthenticator(),
18
- checkingUser = _useAuthenticator.checkingUser,
41
+ var _useAuthenticator = (0, _useAuthenticator2.useAuthenticator)(),
19
42
  authData = _useAuthenticator.authData,
20
43
  changeState = _useAuthenticator.changeState;
21
44
 
22
- var _useForgotPassword = useForgotPassword(),
45
+ var _useForgotPassword = (0, _useForgotPassword2.useForgotPassword)(),
23
46
  loading = _useForgotPassword.loading,
24
47
  codeSent = _useForgotPassword.codeSent,
25
48
  shouldRender = _useForgotPassword.shouldRender,
@@ -27,7 +50,7 @@ var ForgotPassword = function ForgotPassword() {
27
50
  requestCode = _useForgotPassword.requestCode,
28
51
  error = _useForgotPassword.error;
29
52
 
30
- if (!shouldRender || checkingUser) {
53
+ if (!shouldRender) {
31
54
  return null;
32
55
  }
33
56
 
@@ -35,7 +58,7 @@ var ForgotPassword = function ForgotPassword() {
35
58
  _ref$username = _ref.username,
36
59
  username = _ref$username === void 0 ? "" : _ref$username;
37
60
 
38
- return /*#__PURE__*/React.createElement(StateContainer, null, /*#__PURE__*/React.createElement(Form, {
61
+ return /*#__PURE__*/React.createElement(_StateContainer.default, null, /*#__PURE__*/React.createElement(_form.Form, {
39
62
  data: {
40
63
  username: username
41
64
  },
@@ -52,53 +75,53 @@ var ForgotPassword = function ForgotPassword() {
52
75
  var Bind = _ref3.Bind,
53
76
  submit = _ref3.submit,
54
77
  data = _ref3.data;
55
- return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Elevation, {
78
+ return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(_Elevation.Elevation, {
56
79
  z: 2
57
- }, /*#__PURE__*/React.createElement(InnerContent, null, loading && /*#__PURE__*/React.createElement(CircularProgress, null), /*#__PURE__*/React.createElement(Title, null, /*#__PURE__*/React.createElement("h1", null, /*#__PURE__*/React.createElement(Typography, {
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, {
58
81
  use: "headline4"
59
- }, "Password Recovery")), /*#__PURE__*/React.createElement("p", null, /*#__PURE__*/React.createElement(Typography, {
82
+ }, "Password Recovery")), /*#__PURE__*/React.createElement("p", null, /*#__PURE__*/React.createElement(_Typography.Typography, {
60
83
  use: "subtitle2"
61
- }, "request a password reset code"))), error && /*#__PURE__*/React.createElement(Grid, null, /*#__PURE__*/React.createElement(Cell, {
84
+ }, "request a password reset code"))), error && /*#__PURE__*/React.createElement(_Grid.Grid, null, /*#__PURE__*/React.createElement(_Grid.Cell, {
62
85
  span: 12
63
- }, /*#__PURE__*/React.createElement(Alert, {
86
+ }, /*#__PURE__*/React.createElement(_Alert.Alert, {
64
87
  title: "Something went wrong",
65
88
  type: "danger"
66
- }, error))), !codeSent ? /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Grid, null, /*#__PURE__*/React.createElement(Cell, {
89
+ }, error))), !codeSent ? /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(_Grid.Grid, null, /*#__PURE__*/React.createElement(_Grid.Cell, {
67
90
  span: 12
68
91
  }, /*#__PURE__*/React.createElement(Bind, {
69
92
  name: "username",
70
- validators: validation.create("required"),
93
+ validators: _validation.validation.create("required"),
71
94
  beforeChange: function beforeChange(val, cb) {
72
95
  return cb(val.toLowerCase());
73
96
  }
74
- }, /*#__PURE__*/React.createElement(Input, {
97
+ }, /*#__PURE__*/React.createElement(_Input.Input, {
75
98
  label: "Email",
76
99
  description: "A reset code will be sent to your email."
77
- })))), /*#__PURE__*/React.createElement(Grid, null, /*#__PURE__*/React.createElement(Cell, {
100
+ })))), /*#__PURE__*/React.createElement(_Grid.Grid, null, /*#__PURE__*/React.createElement(_Grid.Cell, {
78
101
  span: 12,
79
- className: alignRight
80
- }, /*#__PURE__*/React.createElement(ButtonPrimary, {
102
+ className: _StyledComponents.alignRight
103
+ }, /*#__PURE__*/React.createElement(_Button.ButtonPrimary, {
81
104
  onClick: function onClick(ev) {
82
105
  submit(ev);
83
106
  }
84
- }, "Send me the code")))) : /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Grid, null, /*#__PURE__*/React.createElement(Cell, {
107
+ }, "Send me the code")))) : /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(_Grid.Grid, null, /*#__PURE__*/React.createElement(_Grid.Cell, {
85
108
  span: 12
86
- }, /*#__PURE__*/React.createElement(Typography, {
109
+ }, /*#__PURE__*/React.createElement(_Typography.Typography, {
87
110
  use: "body1"
88
- }, "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, null, /*#__PURE__*/React.createElement(Cell, {
111
+ }, "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, {
89
112
  span: 12,
90
- className: alignRight
91
- }, /*#__PURE__*/React.createElement(ButtonDefault, {
113
+ className: _StyledComponents.alignRight
114
+ }, /*#__PURE__*/React.createElement(_Button.ButtonDefault, {
92
115
  onClick: function onClick() {
93
116
  requestCode({
94
117
  username: data.username
95
118
  });
96
119
  }
97
- }, "Resend code"), /*#__PURE__*/React.createElement(ButtonPrimary, {
120
+ }, "Resend code"), /*#__PURE__*/React.createElement(_Button.ButtonPrimary, {
98
121
  onClick: function onClick(ev) {
99
122
  submit(ev);
100
123
  }
101
- }, "I got the code!")))))), /*#__PURE__*/React.createElement(Grid, null, /*#__PURE__*/React.createElement(Cell, {
124
+ }, "I got the code!")))))), /*#__PURE__*/React.createElement(_Grid.Grid, null, /*#__PURE__*/React.createElement(_Grid.Cell, {
102
125
  span: 12,
103
126
  style: {
104
127
  textAlign: "center"
@@ -112,4 +135,5 @@ var ForgotPassword = function ForgotPassword() {
112
135
  }));
113
136
  };
114
137
 
115
- export default ForgotPassword;
138
+ var _default = ForgotPassword;
139
+ exports.default = _default;
@@ -1 +1 @@
1
- {"version":3,"sources":["ForgotPassword.tsx"],"names":["React","Form","validation","ButtonPrimary","ButtonDefault","Input","Grid","Cell","Typography","Alert","Elevation","StateContainer","alignRight","InnerContent","Title","CircularProgress","useAuthenticator","useForgotPassword","ForgotPassword","checkingUser","authData","changeState","loading","codeSent","shouldRender","setPassword","requestCode","error","username","Bind","submit","data","create","val","cb","toLowerCase","ev","textAlign"],"mappings":"AAAA,OAAO,KAAKA,KAAZ,MAAuB,OAAvB;AACA,SAASC,IAAT,QAAqB,cAArB;AACA,SAASC,UAAT,QAA2B,oBAA3B;AACA,SAASC,aAAT,EAAwBC,aAAxB,QAA6C,mBAA7C;AACA,SAASC,KAAT,QAAsB,kBAAtB;AACA,SAASC,IAAT,EAAeC,IAAf,QAA2B,iBAA3B;AACA,SAASC,UAAT,QAA2B,uBAA3B;AACA,SAASC,KA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,oBAAC,IAAD,qBACI,oBAAC,IAAD;AAAM,MAAA,IAAI,EAAE;AAAZ,oBACI,oBAAC,UAAD;AAAY,MAAA,GAAG,EAAC;AAAhB,uEAEI,+BAFJ,eAGI,+BAHJ,8GADJ,CADJ,CADJ,eAaI,oBAAC,IAAD,qBACI,oBAAC,IAAD;AAAM,MAAA,IAAI,EAAE,EAAZ;AAAgB,MAAA,SAAS,EAAExB;AAA3B,oBACI,oBAAC,aAAD;AACI,MAAA,OAAO,EAAE,mBAAM;AACXc,QAAAA,WAAW,CAAC;AAAEE,UAAAA,QAAQ,EAAEG,IAAI,CAACH;AAAjB,SAAD,CAAX;AACH;AAHL,OAKK,aALL,CADJ,eAQI,oBAAC,aAAD;AACI,MAAA,OAAO,EAAE,iBAAAQ,EAAE,EAAI;AACXN,QAAAA,MAAM,CAACM,EAAD,CAAN;AACH;AAHL,yBARJ,CADJ,CAbJ,CA1DR,CADJ,CADJ,eA+FI,oBAAC,IAAD,qBACI,oBAAC,IAAD;AAAM,MAAA,IAAI,EAAE,EAAZ;AAAgB,MAAA,KAAK,EAAE;AAAEC,QAAAA,SAAS,EAAE;AAAb;AAAvB,yCAEI;AAAG,MAAA,IAAI,EAAE,GAAT;AAAc,MAAA,OAAO,EAAE;AAAA,eAAMhB,WAAW,CAAC,QAAD,CAAjB;AAAA;AAAvB,iBAFJ,CADJ,CA/FJ,CADH;AAAA,GAPL,CADJ,CADJ;AAsHH,CAjID;;AAmIA,eAAeH,cAAf","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 { checkingUser, authData, changeState } = useAuthenticator();\n const { loading, codeSent, shouldRender, setPassword, requestCode, error } =\n useForgotPassword();\n\n if (!shouldRender || checkingUser) {\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=\"subtitle2\">\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 >\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 &quot;Resend code&quot; button below\n to resend the code in case you haven&apos;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>\n </Cell>\n </Grid>\n </>\n )}\n </Form>\n </StateContainer>\n );\n};\n\nexport default ForgotPassword;\n"]}
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=\"subtitle2\">\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 >\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 &quot;Resend code&quot; button below\n to resend the code in case you haven&apos;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>\n </Cell>\n </Grid>\n </>\n )}\n </Form>\n </StateContainer>\n );\n};\n\nexport default ForgotPass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M;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,CA1DR,CADJ,CADJ,eA+FI,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,CA/FJ,CADH;EAAA,CAPL,CADJ,CADJ;AAsHH,CAjID;;eAmIeH,c"}
@@ -0,0 +1,3 @@
1
+ import React from "react";
2
+ declare const LoggingIn: React.FC;
3
+ export default LoggingIn;
@@ -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"}