//
// SPDX-License-Identifier: AGPL-3.0
-import actions, { AuthAction } from "./auth-action";
+import { authActions, AuthAction } from "./auth-action";
import { User } from "../../models/user";
import { authService } from "../../services/services";
import { removeServerApiAuthorizationHeader, setServerApiAuthorizationHeader } from "../../common/api/server-api";
apiToken?: string;
}
-const authReducer = (state: AuthState = {}, action: AuthAction) => {
- return actions.match(action, {
+export const authReducer = (state: AuthState = {}, action: AuthAction) => {
+ return authActions.match(action, {
SAVE_API_TOKEN: (token: string) => {
authService.saveApiToken(token);
setServerApiAuthorizationHeader(token);
default: () => state
});
};
-
-export default authReducer;