Skip to content

Commit

Permalink
[faucet/frontend] fix: patch jwt token dependencies to 9.0.0
Browse files Browse the repository at this point in the history
update jsonwebtoken dependency
  • Loading branch information
AnthonyLaw authored and Wayonb committed Jun 28, 2023
1 parent f01be7f commit 7df597e
Show file tree
Hide file tree
Showing 4 changed files with 318 additions and 347 deletions.
4 changes: 2 additions & 2 deletions faucet/frontend/components/common/FaucetForm/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import Button from '../Button';
import TextBox from '../TextBox';
import TwitterSignIn from '../TwitterSignIn';
import axios from 'axios';
import { decode } from 'jsonwebtoken';
import jwt from 'jsonwebtoken';
import PropTypes from 'prop-types';
import React, { useEffect, useState } from 'react';
import { ToastContainer, toast } from 'react-toastify';
Expand Down Expand Up @@ -69,7 +69,7 @@ const FaucetForm = function ({ config, addressValidation }) {
const numericAmount = 0 === Number(amount) ? defaultAmount : Number(amount);
const isAddressValid = addressValidation(formattedAddress);
const isAmountValid = !Number.isNaN(numericAmount) && 0 <= numericAmount && numericAmount <= config.maxAmount;
const twitterInfo = decode(sessionStorage.getItem('authToken'));
const twitterInfo = jwt.decode(sessionStorage.getItem('authToken'));

const isTwitterVerify = getTwitterVerifyStatus(twitterInfo);

Expand Down
4 changes: 2 additions & 2 deletions faucet/frontend/components/common/TwitterSignIn/index.jsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { decrypt, encrypt } from '../../../utils/helper';
import Button from '../Button';
import axios from 'axios';
import { decode } from 'jsonwebtoken';
import jwt from 'jsonwebtoken';
import PropTypes from 'prop-types';
import React, { useEffect, useState } from 'react';

Expand Down Expand Up @@ -34,7 +34,7 @@ const TwitterSignIn = function ({
};

useEffect(() => {
const twitterInfo = decode(sessionStorage.getItem('authToken'));
const twitterInfo = jwt.decode(sessionStorage.getItem('authToken'));

const query = new URLSearchParams(window.location.search);
const oauthToken = query.get('oauth_token');
Expand Down
Loading

0 comments on commit 7df597e

Please sign in to comment.