Add note about fetchApi not being suitable for sign-in page use

Signed-off-by: Fredrik Adelöw <freben@gmail.com>
This commit is contained in:
Fredrik Adelöw
2022-08-15 13:14:03 +02:00
parent 46956e6fef
commit 87649a06bf
2 changed files with 12 additions and 0 deletions
+5
View File
@@ -0,0 +1,5 @@
---
'@backstage/core-plugin-api': patch
---
Add a note that the `fetchApi` utility should not be used on sign-in page implementations and similar.
@@ -37,6 +37,13 @@ export type FetchApi = {
* This is a wrapper for the fetch API, that has additional behaviors such as
* the ability to automatically inject auth information where necessary.
*
* Note that the default behavior of this API (unless overridden by your org),
* is to require that the user is already signed in so that it has auth
* information to inject. Therefore, using the default implementation of this
* utility API e.g. on the `SignInPage` or similar, would cause issues. In
* special circumstances like those, you can use the regular system `fetch`
* instead.
*
* @public
*/
export const fetchApiRef: ApiRef<FetchApi> = createApiRef({