mirror of
https://github.com/scm-manager/scm-manager.git
synced 2025-11-09 06:55:47 +01:00
fix review findings
This commit is contained in:
@@ -118,7 +118,7 @@ describe("auth actions", () => {
|
||||
fetchMock.postOnce("/api/v2/auth/access_token", {
|
||||
body: {
|
||||
cookie: true,
|
||||
grantType: "password",
|
||||
grant_type: "password",
|
||||
username: "tricia",
|
||||
password: "secret123"
|
||||
},
|
||||
|
||||
@@ -32,7 +32,8 @@ import {
|
||||
callFetchIndexResources,
|
||||
fetchIndexResources,
|
||||
fetchIndexResourcesPending,
|
||||
fetchIndexResourcesSuccess, getLoginLink
|
||||
fetchIndexResourcesSuccess,
|
||||
getLoginLink
|
||||
} from "./indexResource";
|
||||
import { AnyAction } from "redux";
|
||||
|
||||
@@ -176,7 +177,7 @@ const callFetchMe = (link: string): Promise<Me> => {
|
||||
export const login = (loginLink: string, username: string, password: string) => {
|
||||
const loginData = {
|
||||
cookie: true,
|
||||
grantType: "password",
|
||||
grant_type: "password",
|
||||
username,
|
||||
password
|
||||
};
|
||||
@@ -219,7 +220,7 @@ export const fetchMe = (link: string) => {
|
||||
};
|
||||
};
|
||||
|
||||
export const logout = (link: string) => {
|
||||
export const logout = (link: string, callback: () => void) => {
|
||||
return function(dispatch: any) {
|
||||
dispatch(logoutPending());
|
||||
return apiClient
|
||||
@@ -247,6 +248,7 @@ export const logout = (link: string) => {
|
||||
dispatch(fetchIndexResources());
|
||||
}
|
||||
})
|
||||
.then(callback)
|
||||
.catch(error => {
|
||||
dispatch(logoutFailure(error));
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user