File tree Expand file tree Collapse file tree
src/features/confirmation/views/ConfirmSignIn Expand file tree Collapse file tree Original file line number Diff line number Diff line change 250250 "confirmation.signIn.resources" : {
251251 "message" : " Resources"
252252 },
253+ "confirmation.signIn.badDomain" : {
254+ "message" : " This site is asking you to sign in using the wrong domain."
255+ },
253256 "transactionScan.errors.accountAlreadyInUse" : {
254257 "message" : " An account with the same address already exists."
255258 },
Original file line number Diff line number Diff line change 8282 "confirmation.signIn.notBefore" : " Not before" ,
8383 "confirmation.signIn.requestId" : " Request ID" ,
8484 "confirmation.signIn.resources" : " Resources" ,
85+ "confirmation.signIn.badDomain" : " This site is asking you to sign in using the wrong domain." ,
8586 "transactionScan.errors.accountAlreadyInUse" : " An account with the same address already exists." ,
8687 "transactionScan.errors.insufficientSol" : " Account does not have enough SOL to perform the operation." ,
8788 "transactionScan.errors.slippageToleranceExceeded" : " The transaction was reverted because the slippage tolerance was exceeded." ,
Original file line number Diff line number Diff line change 77 "url" : " https://github.com/MetaMask/snap-solana-wallet.git"
88 },
99 "source" : {
10- "shasum" : " Lu8ZjslFGAsh8xSiKiOPdzbyxIG8Hrp7h6ijDea9oVo =" ,
10+ "shasum" : " CGJCQcU/gwXmG51oX44op5db6mwEBogWvzfbBJZ26bs =" ,
1111 "location" : {
1212 "npm" : {
1313 "filePath" : " dist/bundle.js" ,
Original file line number Diff line number Diff line change @@ -74,6 +74,7 @@ export const ConfirmSignIn: SnapComponent<ConfirmSignInProps> = ({
7474 const signInAddressCaip10 = address ? addressToCaip10 ( scope , address ) : null ;
7575
7676 const isBadAccount = signInAddressCaip10 !== accountAddressCaip10 ;
77+ const isBadDomain = domain !== originHostname ;
7778
7879 return (
7980 < Container >
@@ -104,7 +105,15 @@ export const ConfirmSignIn: SnapComponent<ConfirmSignInProps> = ({
104105 < Text > { originHostname } </ Text >
105106 </ Row >
106107 ) : null }
107- < Row label = { translate ( 'confirmation.signIn.domain' ) } >
108+ < Row
109+ variant = { isBadDomain ? 'critical' : 'default' }
110+ label = { translate ( 'confirmation.signIn.domain' ) }
111+ tooltip = {
112+ isBadDomain
113+ ? translate ( 'confirmation.signIn.badDomain' )
114+ : undefined
115+ }
116+ >
108117 < Text >
109118 { domain ?? translate ( 'confirmation.signIn.unknownDomain' ) }
110119 </ Text >
@@ -212,7 +221,10 @@ export const ConfirmSignIn: SnapComponent<ConfirmSignInProps> = ({
212221 < Button name = { ConfirmSignInFormNames . Cancel } >
213222 { translate ( 'confirmation.cancelButton' ) }
214223 </ Button >
215- < Button name = { ConfirmSignInFormNames . Confirm } >
224+ < Button
225+ name = { ConfirmSignInFormNames . Confirm }
226+ variant = { isBadDomain ? 'destructive' : 'primary' }
227+ >
216228 { translate ( 'confirmation.confirmButton' ) }
217229 </ Button >
218230 </ Footer >
You can’t perform that action at this time.
0 commit comments