@backstage/plugin-auth-react 0.0.0-nightly-20240715022028 → 0.0.0-nightly-20240724021820
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/CHANGELOG.md
CHANGED
|
@@ -1,11 +1,31 @@
|
|
|
1
1
|
# @backstage/plugin-auth-react
|
|
2
2
|
|
|
3
|
-
## 0.0.0-nightly-
|
|
3
|
+
## 0.0.0-nightly-20240724021820
|
|
4
4
|
|
|
5
5
|
### Patch Changes
|
|
6
6
|
|
|
7
|
+
- aeac3e9: feat: Hide visibility of CookieAuthRedirect
|
|
7
8
|
- Updated dependencies
|
|
8
|
-
- @backstage/core-components@0.0.0-nightly-
|
|
9
|
+
- @backstage/core-components@0.0.0-nightly-20240724021820
|
|
10
|
+
- @backstage/core-plugin-api@1.9.3
|
|
11
|
+
- @backstage/errors@1.2.4
|
|
12
|
+
|
|
13
|
+
## 0.1.5-next.0
|
|
14
|
+
|
|
15
|
+
### Patch Changes
|
|
16
|
+
|
|
17
|
+
- aeac3e9: feat: Hide visibility of CookieAuthRedirect
|
|
18
|
+
- Updated dependencies
|
|
19
|
+
- @backstage/core-components@0.14.10-next.0
|
|
20
|
+
- @backstage/core-plugin-api@1.9.3
|
|
21
|
+
- @backstage/errors@1.2.4
|
|
22
|
+
|
|
23
|
+
## 0.1.4
|
|
24
|
+
|
|
25
|
+
### Patch Changes
|
|
26
|
+
|
|
27
|
+
- Updated dependencies
|
|
28
|
+
- @backstage/core-components@0.14.9
|
|
9
29
|
- @backstage/core-plugin-api@1.9.3
|
|
10
30
|
- @backstage/errors@1.2.4
|
|
11
31
|
|
|
@@ -21,7 +21,8 @@ function CookieAuthRedirect() {
|
|
|
21
21
|
{
|
|
22
22
|
ref: (form) => form?.submit(),
|
|
23
23
|
action: window.location.href,
|
|
24
|
-
method: "POST"
|
|
24
|
+
method: "POST",
|
|
25
|
+
style: { visibility: "hidden" }
|
|
25
26
|
},
|
|
26
27
|
/* @__PURE__ */ React.createElement("input", { type: "hidden", name: "type", value: "sign-in" }),
|
|
27
28
|
/* @__PURE__ */ React.createElement("input", { type: "hidden", name: "token", value: state.result }),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CookieAuthRedirect.esm.js","sources":["../../../src/components/CookieAuthRedirect/CookieAuthRedirect.tsx"],"sourcesContent":["/*\n * Copyright 2024 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport React from 'react';\nimport { identityApiRef, useApi } from '@backstage/core-plugin-api';\nimport { useAsync, useMountEffect } from '@react-hookz/web';\n\n/**\n * @public\n * A component that redirects to the page an user was trying to access before sign-in.\n */\nexport function CookieAuthRedirect() {\n const identityApi = useApi(identityApiRef);\n\n const [state, actions] = useAsync(async () => {\n const { token } = await identityApi.getCredentials();\n if (!token) {\n throw new Error('Expected Backstage token in sign-in response');\n }\n return token;\n });\n\n useMountEffect(actions.execute);\n\n if (state.status === 'error' && state.error) {\n return <>An error occurred: {state.error.message}</>;\n }\n\n if (state.status === 'success' && state.result) {\n return (\n <form\n ref={form => form?.submit()}\n action={window.location.href}\n method=\"POST\"\n >\n <input type=\"hidden\" name=\"type\" value=\"sign-in\" />\n <input type=\"hidden\" name=\"token\" value={state.result} />\n <input type=\"submit\" value=\"Continue\" />\n </form>\n );\n }\n\n return null;\n}\n"],"names":[],"mappings":";;;;AAwBO,SAAS,kBAAqB,GAAA;AACnC,EAAM,MAAA,WAAA,GAAc,OAAO,cAAc,CAAA,CAAA;AAEzC,EAAA,MAAM,CAAC,KAAA,EAAO,OAAO,CAAA,GAAI,SAAS,YAAY;AAC5C,IAAA,MAAM,EAAE,KAAA,EAAU,GAAA,MAAM,YAAY,cAAe,EAAA,CAAA;AACnD,IAAA,IAAI,CAAC,KAAO,EAAA;AACV,MAAM,MAAA,IAAI,MAAM,8CAA8C,CAAA,CAAA;AAAA,KAChE;AACA,IAAO,OAAA,KAAA,CAAA;AAAA,GACR,CAAA,CAAA;AAED,EAAA,cAAA,CAAe,QAAQ,OAAO,CAAA,CAAA;AAE9B,EAAA,IAAI,KAAM,CAAA,MAAA,KAAW,OAAW,IAAA,KAAA,CAAM,KAAO,EAAA;AAC3C,IAAA,uBAAS,KAAA,CAAA,aAAA,CAAA,KAAA,CAAA,QAAA,EAAA,IAAA,EAAA,qBAAA,EAAoB,KAAM,CAAA,KAAA,CAAM,OAAQ,CAAA,CAAA;AAAA,GACnD;AAEA,EAAA,IAAI,KAAM,CAAA,MAAA,KAAW,SAAa,IAAA,KAAA,CAAM,MAAQ,EAAA;AAC9C,IACE,uBAAA,KAAA,CAAA,aAAA;AAAA,MAAC,MAAA;AAAA,MAAA;AAAA,QACC,GAAA,EAAK,CAAQ,IAAA,KAAA,IAAA,EAAM,MAAO,EAAA;AAAA,QAC1B,MAAA,EAAQ,OAAO,QAAS,CAAA,IAAA;AAAA,QACxB,MAAO,EAAA,MAAA;AAAA,OAAA;AAAA,
|
|
1
|
+
{"version":3,"file":"CookieAuthRedirect.esm.js","sources":["../../../src/components/CookieAuthRedirect/CookieAuthRedirect.tsx"],"sourcesContent":["/*\n * Copyright 2024 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport React from 'react';\nimport { identityApiRef, useApi } from '@backstage/core-plugin-api';\nimport { useAsync, useMountEffect } from '@react-hookz/web';\n\n/**\n * @public\n * A component that redirects to the page an user was trying to access before sign-in.\n */\nexport function CookieAuthRedirect() {\n const identityApi = useApi(identityApiRef);\n\n const [state, actions] = useAsync(async () => {\n const { token } = await identityApi.getCredentials();\n if (!token) {\n throw new Error('Expected Backstage token in sign-in response');\n }\n return token;\n });\n\n useMountEffect(actions.execute);\n\n if (state.status === 'error' && state.error) {\n return <>An error occurred: {state.error.message}</>;\n }\n\n if (state.status === 'success' && state.result) {\n return (\n <form\n ref={form => form?.submit()}\n action={window.location.href}\n method=\"POST\"\n style={{ visibility: 'hidden' }}\n >\n <input type=\"hidden\" name=\"type\" value=\"sign-in\" />\n <input type=\"hidden\" name=\"token\" value={state.result} />\n <input type=\"submit\" value=\"Continue\" />\n </form>\n );\n }\n\n return null;\n}\n"],"names":[],"mappings":";;;;AAwBO,SAAS,kBAAqB,GAAA;AACnC,EAAM,MAAA,WAAA,GAAc,OAAO,cAAc,CAAA,CAAA;AAEzC,EAAA,MAAM,CAAC,KAAA,EAAO,OAAO,CAAA,GAAI,SAAS,YAAY;AAC5C,IAAA,MAAM,EAAE,KAAA,EAAU,GAAA,MAAM,YAAY,cAAe,EAAA,CAAA;AACnD,IAAA,IAAI,CAAC,KAAO,EAAA;AACV,MAAM,MAAA,IAAI,MAAM,8CAA8C,CAAA,CAAA;AAAA,KAChE;AACA,IAAO,OAAA,KAAA,CAAA;AAAA,GACR,CAAA,CAAA;AAED,EAAA,cAAA,CAAe,QAAQ,OAAO,CAAA,CAAA;AAE9B,EAAA,IAAI,KAAM,CAAA,MAAA,KAAW,OAAW,IAAA,KAAA,CAAM,KAAO,EAAA;AAC3C,IAAA,uBAAS,KAAA,CAAA,aAAA,CAAA,KAAA,CAAA,QAAA,EAAA,IAAA,EAAA,qBAAA,EAAoB,KAAM,CAAA,KAAA,CAAM,OAAQ,CAAA,CAAA;AAAA,GACnD;AAEA,EAAA,IAAI,KAAM,CAAA,MAAA,KAAW,SAAa,IAAA,KAAA,CAAM,MAAQ,EAAA;AAC9C,IACE,uBAAA,KAAA,CAAA,aAAA;AAAA,MAAC,MAAA;AAAA,MAAA;AAAA,QACC,GAAA,EAAK,CAAQ,IAAA,KAAA,IAAA,EAAM,MAAO,EAAA;AAAA,QAC1B,MAAA,EAAQ,OAAO,QAAS,CAAA,IAAA;AAAA,QACxB,MAAO,EAAA,MAAA;AAAA,QACP,KAAA,EAAO,EAAE,UAAA,EAAY,QAAS,EAAA;AAAA,OAAA;AAAA,0CAE7B,OAAM,EAAA,EAAA,IAAA,EAAK,UAAS,IAAK,EAAA,MAAA,EAAO,OAAM,SAAU,EAAA,CAAA;AAAA,sBACjD,KAAA,CAAA,aAAA,CAAC,WAAM,IAAK,EAAA,QAAA,EAAS,MAAK,OAAQ,EAAA,KAAA,EAAO,MAAM,MAAQ,EAAA,CAAA;AAAA,sBACtD,KAAA,CAAA,aAAA,CAAA,OAAA,EAAA,EAAM,IAAK,EAAA,QAAA,EAAS,OAAM,UAAW,EAAA,CAAA;AAAA,KACxC,CAAA;AAAA,GAEJ;AAEA,EAAO,OAAA,IAAA,CAAA;AACT;;;;"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@backstage/plugin-auth-react",
|
|
3
|
-
"version": "0.0.0-nightly-
|
|
3
|
+
"version": "0.0.0-nightly-20240724021820",
|
|
4
4
|
"description": "Web library for the auth plugin",
|
|
5
5
|
"backstage": {
|
|
6
6
|
"role": "web-library",
|
|
@@ -38,7 +38,7 @@
|
|
|
38
38
|
"test": "backstage-cli package test"
|
|
39
39
|
},
|
|
40
40
|
"dependencies": {
|
|
41
|
-
"@backstage/core-components": "^0.0.0-nightly-
|
|
41
|
+
"@backstage/core-components": "^0.0.0-nightly-20240724021820",
|
|
42
42
|
"@backstage/core-plugin-api": "^1.9.3",
|
|
43
43
|
"@backstage/errors": "^1.2.4",
|
|
44
44
|
"@material-ui/core": "^4.9.13",
|
|
@@ -46,8 +46,8 @@
|
|
|
46
46
|
"@types/react": "^16.13.1 || ^17.0.0 || ^18.0.0"
|
|
47
47
|
},
|
|
48
48
|
"devDependencies": {
|
|
49
|
-
"@backstage/cli": "^0.0.0-nightly-
|
|
50
|
-
"@backstage/test-utils": "^0.0.0-nightly-
|
|
49
|
+
"@backstage/cli": "^0.0.0-nightly-20240724021820",
|
|
50
|
+
"@backstage/test-utils": "^0.0.0-nightly-20240724021820",
|
|
51
51
|
"@testing-library/jest-dom": "^6.0.0",
|
|
52
52
|
"@testing-library/react": "^15.0.0",
|
|
53
53
|
"@testing-library/user-event": "^14.0.0",
|