Skip to content

Commit

Permalink
Merge pull request #3475 from cardano-foundation/fix/update-sign-in-p…
Browse files Browse the repository at this point in the history
…ayload

fix: update signin payload
  • Loading branch information
Sotatek-TaiTruong authored May 16, 2024
2 parents 621b403 + 7c21f6d commit e95d06e
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/components/commons/Layout/Header/ConnectWallet/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -84,13 +84,14 @@ const ConnectWallet: React.FC<Props> = ({ customButton, onSuccess }) => {
// eslint-disable-next-line react-hooks/exhaustive-deps
}, [stakeAddress]);

const handleSignIn = async (signature: string, nonce: NonceObject | null) => {
const handleSignIn = async (signature: string, nonce: NonceObject | null, key?: string) => {
try {
setSignature(signature);
if (nonce?.nonce) {
const payload = {
address: stakeAddress || "",
signature,
key,
type: 1
};
const response = await signIn(payload);
Expand Down Expand Up @@ -128,8 +129,8 @@ const ConnectWallet: React.FC<Props> = ({ customButton, onSuccess }) => {
!isSignP2P && setDisableSignButton(true);
await signMessage(
nonceValue.nonce,
(signature: string) => {
handleSignIn(signature, nonceValue);
(signature: string, key?: string) => {
handleSignIn(signature, nonceValue, key);
},
() => {
toast.error(t("message.user.rejected"));
Expand Down

0 comments on commit e95d06e

Please sign in to comment.