Skip to content
This repository has been archived by the owner on May 21, 2021. It is now read-only.

Commit

Permalink
closes #6 bypass auth in development
Browse files Browse the repository at this point in the history
  • Loading branch information
skyl committed Jul 4, 2018
1 parent 7ebf6f8 commit dccbda1
Show file tree
Hide file tree
Showing 7 changed files with 35 additions and 6 deletions.
2 changes: 2 additions & 0 deletions .env
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
REACT_APP_ZCASH_USERNAME=''
REACT_APP_ZCASH_PASSWORD=''
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
node_modules
*.log
.env

7 changes: 7 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,3 +32,10 @@ app will update live! Sweet!
cd applications/ZcashOSX
yarn macos
```

To bypass the auth screen while developing,
set `REACT_APP_ZCASH_USERNAME` and `REACT_APP_ZCASH_PASSWORD`
in the `.env` file in the root directory.
Note: to toggle this with the application running,
you might need to change and save `core/state/reducers.js`
to provoke babel to retranspile that file.
2 changes: 1 addition & 1 deletion applications/ZcashOSX/.babelrc
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"presets": ["react-native"],
"presets": ["react-native", "react-native-dotenv"],
"plugins": [
["module-resolver", {
"alias": {
Expand Down
1 change: 1 addition & 0 deletions applications/ZcashOSX/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
"crna-make-symlinks-for-yarn-workspaces": "^1.0.1",
"jest": "23.1.0",
"metro-bundler-config-yarn-workspaces": "^1.0.3",
"react-native-dotenv": "^0.1.1",
"react-test-renderer": "16.2.0"
},
"jest": {
Expand Down
11 changes: 6 additions & 5 deletions core/state/reducers.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
import { combineReducers } from 'redux'
import {
REACT_APP_ZCASH_USERNAME,
REACT_APP_ZCASH_PASSWORD,
} from 'react-native-dotenv'


// TODO: inject configuration for development
let default_auth = {
username: 'z',
password: 'a',
username: REACT_APP_ZCASH_USERNAME,
password: REACT_APP_ZCASH_PASSWORD,
}
default_auth = {}

const auth = (state = default_auth, action) => {
switch (action.type) {
Expand Down
16 changes: 16 additions & 0 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1133,6 +1133,12 @@ babel-plugin-check-es2015-constants@^6.5.0, babel-plugin-check-es2015-constants@
dependencies:
babel-runtime "^6.22.0"

[email protected]:
version "0.1.1"
resolved "https://registry.yarnpkg.com/babel-plugin-dotenv/-/babel-plugin-dotenv-0.1.1.tgz#9c8faea67a7c034fe7e94099187ab2e7573400bc"
dependencies:
dotenv "^2.0.0"

babel-plugin-external-helpers@^6.18.0, babel-plugin-external-helpers@^6.22.0:
version "6.22.0"
resolved "https://registry.yarnpkg.com/babel-plugin-external-helpers/-/babel-plugin-external-helpers-6.22.0.tgz#2285f48b02bd5dede85175caf8c62e86adccefa1"
Expand Down Expand Up @@ -2590,6 +2596,10 @@ dot-case@^1.1.0:
dependencies:
sentence-case "^1.1.2"

dotenv@^2.0.0:
version "2.0.0"
resolved "https://registry.yarnpkg.com/dotenv/-/dotenv-2.0.0.tgz#bd759c357aaa70365e01c96b7b0bec08a6e0d949"

duplexer3@^0.1.4:
version "0.1.4"
resolved "https://registry.yarnpkg.com/duplexer3/-/duplexer3-0.1.4.tgz#ee01dd1cac0ed3cbc7fdbea37dc0a8f1ce002ce2"
Expand Down Expand Up @@ -6470,6 +6480,12 @@ [email protected]:
version "1.0.0"
resolved "https://registry.yarnpkg.com/react-native-dismiss-keyboard/-/react-native-dismiss-keyboard-1.0.0.tgz#32886242b3f2317e121f3aeb9b0a585e2b879b49"

react-native-dotenv@^0.1.1:
version "0.1.1"
resolved "https://registry.yarnpkg.com/react-native-dotenv/-/react-native-dotenv-0.1.1.tgz#95a943dbaba24ddf50e95bd861e5a0c4ab03a38d"
dependencies:
babel-plugin-dotenv "0.1.1"

react-native-drawer-layout-polyfill@^1.3.2:
version "1.3.2"
resolved "https://registry.yarnpkg.com/react-native-drawer-layout-polyfill/-/react-native-drawer-layout-polyfill-1.3.2.tgz#192c84d7a5a6b8a6d2be2c7daa5e4164518d0cc7"
Expand Down

0 comments on commit dccbda1

Please sign in to comment.