Skip to content

Commit

Permalink
Merge pull request #2599 from hollaex/beta
Browse files Browse the repository at this point in the history
Beta
  • Loading branch information
abeikverdi authored Jan 26, 2024
2 parents 38e3d4e + c0c0405 commit 17005f4
Show file tree
Hide file tree
Showing 13 changed files with 47 additions and 11 deletions.
8 changes: 6 additions & 2 deletions server/api/controllers/user.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ const {
LOGIN_NOT_ALLOW,
NO_IP_FOUND,
INVALID_OTP_CODE,
OTP_CODE_NOT_FOUND
} = require('../../messages');
const { DEFAULT_ORDER_RISK_PERCENTAGE, EVENTS_CHANNEL, API_HOST, DOMAIN, TOKEN_TIME_NORMAL, TOKEN_TIME_LONG, HOLLAEX_NETWORK_BASE_URL, NUMBER_OF_ALLOWED_ATTEMPTS } = require('../../constants');
const { all } = require('bluebird');
Expand Down Expand Up @@ -155,10 +156,10 @@ const getVerifyUser = (req, res) => {
};

const verifyUser = (req, res) => {
const { verification_code } = req.swagger.params.data.value;
const { verification_code, email } = req.swagger.params.data.value;
const domain = req.headers['x-real-origin'];

toolsLib.user.verifyUser(null, verification_code, domain)
toolsLib.user.verifyUser(email, verification_code, domain)
.then(() => {
return res.json({ message: USER_VERIFIED });
})
Expand Down Expand Up @@ -299,6 +300,9 @@ const loginPost = (req, res) => {
return toolsLib.security.checkCaptcha(captcha, ip);
})
.catch(async (err) => {
if (!otp_code) {
throw new Error(OTP_CODE_NOT_FOUND);
}
await toolsLib.user.createUserLogin(user, ip, device, domain, origin, referer, null, long_term, false);
const loginData = await toolsLib.user.findUserLatestLogin(user, false);
const message = createAttemptMessage(loginData, user, domain);
Expand Down
1 change: 0 additions & 1 deletion server/api/swagger/admin.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2955,7 +2955,6 @@ paths:
description: specify whether or not wallet is wallet
required: false
type: boolean
default: true
- in: query
name: network
description: Blockchain network of wallet
Expand Down
3 changes: 3 additions & 0 deletions server/api/swagger/common.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,9 @@ paths:
verification_code:
type: string
maxLength: 256
email:
type: string
maxLength: 256
responses:
200:
description: Success
Expand Down
2 changes: 1 addition & 1 deletion server/api/swagger/swagger.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ const definition = {
swagger: '2.0',
info: {
title: 'HollaEx Kit',
version: '2.9.3'
version: '2.9.4'
},
host: 'api.hollaex.com',
basePath: '/v2',
Expand Down
2 changes: 1 addition & 1 deletion server/mail/templates/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ const replaceHTMLContent = (type, html = '', email, data, language, domain) => {
else if (type === MAILTYPE.SIGNUP) { // ok
html = html.replace(/\$\{name\}/g, email);
html = html.replace(/\$\{api_name\}/g, API_NAME());
html = html.replace(/\$\{link\}/g, `${domain}/verify/${data}`);
html = html.replace(/\$\{link\}/g, `${domain}/verify/${data}?email=${email}`);
}
else if (type === MAILTYPE.WELCOME) { //ok
html = html.replace(/\$\{name\}/g, email || '');
Expand Down
1 change: 1 addition & 0 deletions server/messages.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ exports.TOKEN_REVOKED = 'Token is already revoked';
exports.TOKEN_REMOVED = 'Token is successfully revoked';
exports.TOKEN_OTP_ENABLED = 'OTP must be enabled to create a token';
exports.INVALID_OTP_CODE = 'Invalid OTP Code';
exports.OTP_CODE_NOT_FOUND = 'OTP not found';

exports.WALLET_ERROR_500 =
'Internal error. Withdrawal failed. Please try again in few minutes.';
Expand Down
2 changes: 1 addition & 1 deletion server/package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"version": "2.9.3",
"version": "2.9.4",
"private": false,
"description": "HollaEx Kit",
"keywords": [
Expand Down
2 changes: 1 addition & 1 deletion version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2.9.3
2.9.4
2 changes: 1 addition & 1 deletion web/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "hollaex-kit",
"version": "2.9.3",
"version": "2.9.4",
"private": true,
"dependencies": {
"@ant-design/compatible": "1.0.5",
Expand Down
19 changes: 17 additions & 2 deletions web/src/containers/Admin/AdminFinancials/TableFilter.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React, { useState } from 'react';
import { connect } from 'react-redux';
import { DatePicker, Input, Select, Button } from 'antd';
import { DatePicker, Input, Select, Button, Checkbox } from 'antd';
import { SearchOutlined } from '@ant-design/icons';
import moment from 'moment';

Expand Down Expand Up @@ -68,6 +68,10 @@ const FieldComponent = ({
onHandleFieldChange({ currency: value.toLowerCase() });
};

const onHandleCheck = (value) => {
onHandleFieldChange({ is_valid: value.target.checked });
};

const handleField = (handleRemove, value) => {
switch (type) {
case 'select':
Expand All @@ -88,6 +92,16 @@ const FieldComponent = ({
onChange={onHandle}
/>
);
case 'boolean':
return (
<Checkbox
onChange={onHandleCheck}
checked={object.value}
style={{ color: 'white', marginTop: 5 }}
>
Valid Address
</Checkbox>
);
case 'time-picker':
return (
<DateField
Expand Down Expand Up @@ -153,7 +167,8 @@ const MultiFilter = ({
data.value = data.name;
});
tempfield.forEach((data) => {
data.value = '';
if (data.name === 'is_valid') data.value = true;
else data.value = '';
});
setOptions([...tempOptions]);
setFieldsData([...fieldsData, ...tempfield]);
Expand Down
12 changes: 12 additions & 0 deletions web/src/containers/Admin/AdminFinancials/Wallet.js
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,13 @@ const filterFields = [
type: 'text',
name: 'network',
},
{
label: 'Valid',
value: true,
placeholder: 'Valid',
type: 'boolean',
name: 'is_valid',
},
{
label: 'Time',
name: 'time',
Expand Down Expand Up @@ -95,6 +102,11 @@ const filterOptions = [
value: 'network',
name: 'network',
},
{
label: 'Valid',
value: 'is_valid',
name: 'is_valid',
},
{
label: 'Time',
value: 'time',
Expand Down
1 change: 1 addition & 0 deletions web/src/containers/Admin/Transfers/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ const getFields = (
type: 'select',
label: 'Currency',
placeholder: 'Currency',
showSearch: true,
options: coins,
validate: [validateRequired, validateRange(coins)],
},
Expand Down
3 changes: 2 additions & 1 deletion web/src/containers/VerificationEmailCode/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,8 @@ class VerifyEmailCode extends Component {
onClick={async () => {
this.setState({ confirm: true });
const { code } = this.props.params;
this.props.verifyCode({ verification_code: code });
const { email } = this.props.location.query;
this.props.verifyCode({ verification_code: code, email });
}}
style={{
backgroundColor: '#5D63FF',
Expand Down

0 comments on commit 17005f4

Please sign in to comment.