Skip to content

Commit

Permalink
fix: user verification token
Browse files Browse the repository at this point in the history
 might have / in the string and the match is not correct
  • Loading branch information
mbetancurt committed Jun 25, 2020
1 parent dfb38f0 commit ad758a1
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/Ades.js
Original file line number Diff line number Diff line change
Expand Up @@ -327,7 +327,7 @@ function Ades() {
<Route exact path='/registration'>
<RegistrationScreen/>
</Route>
<Route path='/verify/:username/:token'>
<Route path='/verify/:username'>
<VerificationScreen/>
</Route>
<Route path='/'>
Expand Down
7 changes: 5 additions & 2 deletions src/VerificationScreen.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React, {useEffect, useState} from 'react';
import {Button, Card, Elevation, Intent, Spinner} from '@blueprintjs/core';
import {useTranslation} from 'react-i18next';
import { useParams, useHistory } from 'react-router-dom';
import { useParams, useHistory, useLocation } from 'react-router-dom';
import A from 'axios';
import {API, DEBUG} from './consts';

Expand All @@ -18,7 +18,10 @@ function VerificationScreen() {
const [isLoading, setLoading] = useState(true);

const history = useHistory();
const {username, token} = useParams();
const {username} = useParams();
const location = useLocation();
const token = (location.search.split('?token='))[1];
console.log(token);

const { t, i18n } = useTranslation();

Expand Down

0 comments on commit ad758a1

Please sign in to comment.