Skip to content

Commit

Permalink
🔀 Merge #1823 into deploy/rinkeby
Browse files Browse the repository at this point in the history
  • Loading branch information
AuroraHuang22 committed Oct 3, 2024
2 parents d2af85b + fb054d4 commit d8d59ff
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 7 deletions.
8 changes: 8 additions & 0 deletions src/constant/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -369,3 +369,11 @@ export const NFT_BOOK_WITH_SIGN_IMAGE_SET = new Set(
'likenft1wrskn9a683stkje3wdmcwuvpuqrp5eevjsnn9y4f55wlystzxausuhj3em',
]
);

export const SIGN_AUTHORIZATION_PERMISSIONS = [
'profile',
'read:nftbook',
'write:nftbook',
'read:nftcollection',
'write:nftcollection',
];
3 changes: 3 additions & 0 deletions src/store/modules/bookStoreApi.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,9 @@ const actions = {
} catch (error) {
// eslint-disable-next-line no-console
console.error(error);
if (error.response?.data) {
throw new Error(`AUTHENTICATION_FAILED: ${error.response?.data}`);
}
throw new Error('AUTHENTICATION_FAILED');
}
},
Expand Down
14 changes: 7 additions & 7 deletions src/store/modules/wallet.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import BigNumber from 'bignumber.js';
import {
LIKECOIN_CHAIN_MIN_DENOM,
LIKECOIN_NFT_API_WALLET,
SIGN_AUTHORIZATION_PERMISSIONS,
} from '@/constant/index';
import { LIKECOIN_WALLET_CONNECTOR_CONFIG } from '@/constant/network';
import { catchAxiosError } from '~/util/misc';
Expand Down Expand Up @@ -882,13 +883,12 @@ const actions = {
try {
commit(WALLET_SET_IS_LOGGING_IN, true);
const { signer, methodType } = state;
const data = await signLoginMessage(signer, address, 'authorize', [
'profile',
'read:nftbook',
'write:nftbook',
'read:nftcollection',
'write:nftcollection',
]);
const data = await signLoginMessage(
signer,
address,
'authorize',
SIGN_AUTHORIZATION_PERMISSIONS
);
const result = await this.$api.$post(postUserV2Login(), {
loginMethod: methodType,
...data,
Expand Down

0 comments on commit d8d59ff

Please sign in to comment.