Updates
This commit is contained in:
+2
-1
@@ -1,6 +1,6 @@
|
||||
import logoutUser from "../../actions/users/logout-user";
|
||||
import userAuth from "../../actions/users/user-auth";
|
||||
import { AddUserParams, GetUserParams, LoginUserParam, ResetPasswordParams, SendEmailCodeParams, UpdateUserParams } from "../../types";
|
||||
import { AddUserParams, GetUserParams, GoogleAuthParams, LoginUserParam, ResetPasswordParams, SendEmailCodeParams, UpdateUserParams } from "../../types";
|
||||
type Params = {
|
||||
local?: boolean;
|
||||
};
|
||||
@@ -12,6 +12,7 @@ export default function user(params?: Params): {
|
||||
sendEmailCode: (_: SendEmailCodeParams) => Promise<import("../../types").APIResponseObject>;
|
||||
update: (_: UpdateUserParams) => Promise<import("../../types").UpdateUserFunctionReturn>;
|
||||
resetPassword: (_: ResetPasswordParams) => Promise<import("../../types").UpdateUserFunctionReturn>;
|
||||
googleLogin: (_: GoogleAuthParams) => Promise<import("../../types").APIResponseObject>;
|
||||
logout: typeof logoutUser;
|
||||
auth: typeof userAuth;
|
||||
};
|
||||
|
||||
+6
@@ -19,6 +19,7 @@ const login_user_1 = __importDefault(require("../../actions/users/login-user"));
|
||||
const logout_user_1 = __importDefault(require("../../actions/users/logout-user"));
|
||||
const reset_password_1 = __importDefault(require("../../actions/users/reset-password"));
|
||||
const send_email_code_1 = __importDefault(require("../../actions/users/send-email-code"));
|
||||
const google_auth_1 = __importDefault(require("../../actions/users/social/google-auth"));
|
||||
const update_user_1 = __importDefault(require("../../actions/users/update-user"));
|
||||
const user_auth_1 = __importDefault(require("../../actions/users/user-auth"));
|
||||
function user(params) {
|
||||
@@ -54,6 +55,11 @@ function user(params) {
|
||||
return yield (0, reset_password_1.default)(Object.assign(Object.assign({}, _), { useLocal: true }));
|
||||
})
|
||||
: reset_password_1.default,
|
||||
googleLogin: (params === null || params === void 0 ? void 0 : params.local)
|
||||
? (_) => __awaiter(this, void 0, void 0, function* () {
|
||||
return yield (0, google_auth_1.default)(Object.assign(Object.assign({}, _), { useLocal: true }));
|
||||
})
|
||||
: google_auth_1.default,
|
||||
logout: logout_user_1.default,
|
||||
auth: user_auth_1.default,
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user