Add ErrorDescription with auth and links

ErrorThrownAction triggers an AUTH_EXPIRED in middleware. AuthReducer
extracts auth links to upddate state.links. It's unclear what the shape
is of auth.links:

  Errors.test.js utilizes an auth.links of type
    arrayOf({
      name: string,
      label:string,
      login: string,
      logout: string,
      callback: string,
    })

  OrganizationsPage consumes links w/ shape of

    shape({
      organizations: string.isRequired,
      config: shape({
        auth: string.isRequired,
      }).isRequired,
    })

  UsersPage consumes links w/ shape of

     shape({
        users: string.isRequired,
      }),

  ProvidersPage consumes links w/ shape of

    shape({
        organizations: string.isRequired,
      }),

  Purgatory consumes links w/ shape of

    shape({
      me: string,
    }),

  UserNavBlock at some point expected

  shape({
    me: string,
    external: shape({
      custom: arrayOf(
        shape({
          name: string.isRequired,
          url: string.isRequired,
        })
      ),
    }),
  })
pull/10616/head
Delmer Reed 2018-06-22 18:26:40 -04:00
parent bbd66da6e2
commit 8c2e8a2176
1 changed files with 11 additions and 2 deletions

View File

@ -10,12 +10,12 @@ export type ErrorThrownActionCreator = (
interface ErrorThrownAction {
type: 'ERROR_THROWN'
error: Error
error: ErrorDescription
altText?: string
alertType?: AlertType
}
export const errorThrown = (
error: Error,
error: ErrorDescription,
altText?: string,
alertType?: AlertType
): ErrorThrownAction => ({
@ -24,3 +24,12 @@ export const errorThrown = (
altText,
alertType,
})
interface ErrorDescription {
status: number
auth: {
links: {
me: string
}
}
}