diff --git a/.bumpversion.cfg b/.bumpversion.cfg index 91764cc37..dd3d60359 100644 --- a/.bumpversion.cfg +++ b/.bumpversion.cfg @@ -1,5 +1,5 @@ [bumpversion] -current_version = 0.19.1 +current_version = 0.19.2 commit = True tag = True parse = (?P\d+)\.(?P\d+)\.(?P\d+)((?P[a-z]+)(?P\d+))? diff --git a/CHANGELOG.md b/CHANGELOG.md index 7a57edac4..e0da8b5c7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,7 +8,7 @@ Web UI version numbers should always match the corresponding version of LBRY App ## [Unreleased] ### Added - * Added copy address button to the Wallet Address component on Send / Receive (#875) + * * ### Changed @@ -27,6 +27,24 @@ Web UI version numbers should always match the corresponding version of LBRY App * * +## [0.19.2] - 2017-12-22 + +### Added + * Added copy address button to the Wallet Address component on Send / Receive (#875) + * Link to creators’ channels on homepage (#869) + * Pause playing video when file is opened (#880) + * Add captcha to verification process (#897) + + +### Changed + * Contributor documentation (#879) + + +### Fixed + * Linux app categorization (#877) + + + ## [0.19.1] - 2017-12-13 ### Added diff --git a/package.json b/package.json index dc656400d..55b1a0905 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "LBRY", - "version": "0.19.1", + "version": "0.19.2", "description": "A browser for the LBRY network, a digital marketplace controlled by its users.", "homepage": "https://lbry.io/", "bugs": { diff --git a/src/main/index.js b/src/main/index.js index 6c83391ff..383be184d 100644 --- a/src/main/index.js +++ b/src/main/index.js @@ -95,7 +95,6 @@ function openItem(fullPath) { // Causes child process reference to be garbage collected, allowing main process to exit child.unref(); } - /* * Quits by first killing the daemon, the calling quitting for real. */ @@ -167,7 +166,7 @@ function createWindow() { if (openUri) { // We stored and received a URI that an external app requested before we had a window object window.webContents.on('did-finish-load', () => { - window.webContents.send('open-uri-requested', openUri); + window.webContents.send('open-uri-requested', openUri, true); }); } diff --git a/src/renderer/component/userEmailVerify/index.js b/src/renderer/component/userEmailVerify/index.js index c5ce0376a..9a10f7785 100644 --- a/src/renderer/component/userEmailVerify/index.js +++ b/src/renderer/component/userEmailVerify/index.js @@ -1,6 +1,6 @@ import React from 'react'; import { connect } from 'react-redux'; -import { doUserEmailVerify } from 'redux/actions/user'; +import { doUserEmailVerify, doUserEmailVerifyFailure } from 'redux/actions/user'; import { selectEmailVerifyIsPending, selectEmailToVerify, @@ -20,7 +20,8 @@ const select = state => ({ }); const perform = dispatch => ({ - verifyUserEmail: code => dispatch(doUserEmailVerify(code)), + verifyUserEmail: (code, recaptcha) => dispatch(doUserEmailVerify(code, recaptcha)), + verifyUserEmailFailure: error => dispatch(doUserEmailVerifyFailure(error)), }); export default connect(select, perform)(UserEmailVerify); diff --git a/src/renderer/component/userEmailVerify/view.jsx b/src/renderer/component/userEmailVerify/view.jsx index cae368a96..149b68d17 100644 --- a/src/renderer/component/userEmailVerify/view.jsx +++ b/src/renderer/component/userEmailVerify/view.jsx @@ -20,7 +20,12 @@ class UserEmailVerify extends React.PureComponent { handleSubmit() { const { code } = this.state; - this.props.verifyUserEmail(code); + try { + const verification = JSON.parse(atob(code)); + this.props.verifyUserEmail(verification.token, verification.recaptcha); + } catch (error) { + this.props.verifyUserEmailFailure('Invalid Verification Token'); + } } render() { diff --git a/src/renderer/index.js b/src/renderer/index.js index f0ae0eb61..a5ef55409 100644 --- a/src/renderer/index.js +++ b/src/renderer/index.js @@ -6,7 +6,8 @@ import SnackBar from 'component/snackBar'; import { Provider } from 'react-redux'; import store from 'store'; import SplashScreen from 'component/splash'; -import { doDaemonReady } from 'redux/actions/app'; +import { doDaemonReady, doShowSnackBar, doConditionalAuthNavigate } from 'redux/actions/app'; +import { doUserEmailVerify } from 'redux/actions/user'; import { doNavigate } from 'redux/actions/navigation'; import { doDownloadLanguages } from 'redux/actions/settings'; import * as ACTIONS from 'constants/action_types'; @@ -28,9 +29,24 @@ window.addEventListener('contextmenu', event => { event.preventDefault(); }); -ipcRenderer.on('open-uri-requested', (event, uri) => { +ipcRenderer.on('open-uri-requested', (event, uri, newSession) => { if (uri && uri.startsWith('lbry://')) { - app.store.dispatch(doNavigate('/show', { uri })); + if (uri.startsWith('lbry://?verify=')) { + let verification = {}; + try { + verification = JSON.parse(atob(uri.substring(15))); + } catch (error) { + console.log(error); + } + if (verification.token && verification.recaptcha) { + app.store.dispatch(doConditionalAuthNavigate(newSession)); + app.store.dispatch(doUserEmailVerify(verification.token, verification.recaptcha)); + } else { + app.store.dispatch(doShowSnackBar({ message: 'Invalid Verification URI' })); + } + } else { + app.store.dispatch(doNavigate('/show', { uri })); + } } }); diff --git a/src/renderer/redux/actions/app.js b/src/renderer/redux/actions/app.js index 568abb881..3eb7b74ed 100644 --- a/src/renderer/redux/actions/app.js +++ b/src/renderer/redux/actions/app.js @@ -15,7 +15,8 @@ import { doAuthenticate } from 'redux/actions/user'; import { doFetchFileInfosAndPublishedClaims } from 'redux/actions/file_info'; import * as MODALS from 'constants/modal_types'; import { doFetchRewardedContent } from 'redux/actions/content'; -import { ipcRenderer, remote } from 'electron'; +import { doAuthNavigate } from 'redux/actions/navigation'; +import { remote, ipcRenderer } from 'electron'; import Path from 'path'; const { download } = remote.require('electron-dl'); @@ -261,3 +262,12 @@ export function doChangeVolume(volume) { }); }; } + +export function doConditionalAuthNavigate(newSession) { + return function(dispatch, getState) { + const state = getState(); + if (newSession || selectCurrentModal(state) !== 'email_collection') { + dispatch(doAuthNavigate()); + } + }; +} diff --git a/src/renderer/redux/actions/user.js b/src/renderer/redux/actions/user.js index 1dfbee4ca..32d9fafc8 100644 --- a/src/renderer/redux/actions/user.js +++ b/src/renderer/redux/actions/user.js @@ -116,20 +116,31 @@ export function doUserEmailNew(email) { }; } -export function doUserEmailVerify(verificationToken) { +export function doUserEmailVerifyFailure(error) { + return { + type: ACTIONS.USER_EMAIL_VERIFY_FAILURE, + data: { error }, + }; +} + +export function doUserEmailVerify(verificationToken, recaptcha) { return function(dispatch, getState) { const email = selectEmailToVerify(getState()); - const trimmedVerificationToken = verificationToken.toString().trim(); dispatch({ type: ACTIONS.USER_EMAIL_VERIFY_STARTED, - code: trimmedVerificationToken, + code: verificationToken, + recaptcha, }); Lbryio.call( 'user_email', 'confirm', - { verification_token: trimmedVerificationToken, email }, + { + verification_token: verificationToken, + email, + recaptcha, + }, 'post' ) .then(userEmail => { @@ -144,12 +155,7 @@ export function doUserEmailVerify(verificationToken) { throw new Error('Your email is still not verified.'); // shouldn't happen } }) - .catch(error => { - dispatch({ - type: ACTIONS.USER_EMAIL_VERIFY_FAILURE, - data: { error }, - }); - }); + .catch(error => dispatch(doUserEmailVerifyFailure(error))); }; }