feat(logout): new logout implementation using /logout/v2 API #3513
Conversation
@@ -13,6 +14,10 @@ export class JsonApiError extends Error implements IJsonApiError { | |||
} | |||
} | |||
|
|||
export async function fetch(url: string): Promise<MetaObject> { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Change this to fetch<T>(url: string): Promise<T>
to force clients of this API to provide a proper type.
return function(dispatch) { | ||
return async function(dispatch) { | ||
const logoutUrl = getLogoutUrl(window.location.origin); | ||
const result: { [key: string]: any } = await fetch(logoutUrl); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add a proper interface for the expected response instead of a key / value pair of strings.
The E2E smoke test with feature level set to 'beta' failed. Please review the job results and re-run the job by commenting [e2e-test-beta] if necessary. |
The E2E smoke test with feature level set to 'released' failed. Please review the job results and re-run the job by commenting [e2e-test-released] if necessary. |
🎉 This PR is included in version 5.2.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
…-ui#3513) * feat(logout): new logout implementation using /logout/v2 API * fix(types): add better type checking for fetch
Fixes openshiftio/openshift.io#4742
/logout/v2
endpoint.logout/v2
with redirect param. the response then sends aredirect_location
and we redirect to that url.jsonapi.client
tohttp.client
and added simple fetch method for axios get.