Skip to content

Commit

Permalink
Remove password entry. Closes #1295
Browse files Browse the repository at this point in the history
- component
- container
- route
- registration action savePassword
- unnecessary locale entries
  • Loading branch information
mnzaki committed May 8, 2019
1 parent 0936417 commit 2e368a6
Show file tree
Hide file tree
Showing 10 changed files with 15 additions and 395 deletions.
32 changes: 13 additions & 19 deletions src/actions/registration/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,25 +7,13 @@ import { setDid } from 'src/actions/account'
import { JolocomLib } from 'jolocom-lib'
import { SoftwareKeyProvider } from 'jolocom-lib/js/vaultedKeyProvider/softwareProvider'
const bip39 = require('bip39')
import { generateSecureRandomBytesBase64 } from 'src/lib/util'

export const setLoadingMsg = (loadingMsg: string) => ({
type: 'SET_LOADING_MSG',
value: loadingMsg,
})

export const savePassword = (password: string) => async (
dispatch: Dispatch<AnyAction>,
getState: Function,
backendMiddleware: BackendMiddleware,
) => {
try {
await backendMiddleware.keyChainLib.savePassword(password)
dispatch(navigationActions.navigatorReset({ routeName: routeList.Entropy }))
} catch (err) {
dispatch(genericActions.showErrorScreen(err, routeList.Landing))
}
}

export const submitEntropy = (encodedEntropy: string) => (
dispatch: Dispatch<AnyAction>,
) => {
Expand All @@ -42,12 +30,18 @@ export const submitEntropy = (encodedEntropy: string) => (
}, 2000)
}

export const startRegistration = () => (dispatch: Dispatch<AnyAction>) => {
dispatch(
navigationActions.navigatorReset({
routeName: routeList.PasswordEntry,
}),
)
export const startRegistration = () => async (
dispatch: Dispatch<AnyAction>,
getState: Function,
backendMiddleware: BackendMiddleware,
) => {
try {
const randomPassword = await generateSecureRandomBytesBase64(32)
await backendMiddleware.keyChainLib.savePassword(randomPassword)
dispatch(navigationActions.navigatorReset({ routeName: routeList.Entropy }))
} catch (err) {
dispatch(genericActions.showErrorScreen(err, routeList.Landing))
}
}

export const finishRegistration = () => (dispatch: Dispatch<AnyAction>) => {
Expand Down
10 changes: 0 additions & 10 deletions src/locales/de.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,6 @@ export default {
"For security purposes, we need some randomness": "Aus Sicherheitsgründen brauchen wir zufällig erzeugte Daten",
"Please tap the screen and draw on it randomly": "Tippen Sie auf den Bildschirm und zeichnen Sie drauf los",
"Continue": "Fortsetzen",
"Set a password to encrypt your data on the device": "Legen Sie ein Kennwort fest, um Ihre Daten auf dem Gerät zu verschlüsseln",
"This password will be stored in your keychain": "Dieses Passwort wird in Ihrem Schlüsselbund gespeichert",
"After setting it, please make sure you have passcode enabled": "Vergewissern Sie sich nach der Einstellung, dass ihr Passwortmanager aktiviert ist",
"Password": "Passwort",
"Repeat password": "Wiederhole das Passwort",
"Write these words down on an analog and secure place": "Schreiben Sie diese Wörter an einem analogen und sicheren Ort auf",
"Without these words, you cannot access your wallet again": "Ohne diese Wörter können Sie nicht mehr auf Ihr SmartWallet zugreifen",
"Yes, I wrote it down": "Erledigt",
Expand All @@ -61,10 +56,5 @@ export default {
"Postal Code": "Postleitzahl",
"City": "Stadt",
"Country": "Land",
"At least one number needed": "Es wird mindestens eine Ziffer benötigt",
"At least one uppercase letter needed": "Es wird mindestens ein Großbuchstabe benötigt",
"Passwords do not match": "Die Passwörter stimmen nicht überein",
"No spaces allowed": "Keine Leerzeichen erlaubt",
"At least 8 characters are required": "Es werden mindestens 8 Zeichen benötigt",
"Your Jolocom Wallet": "Deine Jolocom Wallet"
}
10 changes: 0 additions & 10 deletions src/locales/nl.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,6 @@ export default {
"For security purposes, we need some randomness": "Voor de veiligheid hebben we wat willekeur nodig",
"Please tap the screen and draw on it randomly": "Tik op het scherm en teken er willekeurig op",
"Continue": "Doorgaan",
"Set a password to encrypt your data on the device": "Gebruik een wachtwoord om uw gegevens op het apparaat te versleutelen",
"This password will be stored in your keychain": "Dit wachtwoord wordt opgeslagen in uw sleutelhanger",
"After setting it, please make sure you have passcode enabled": "Zorg er na het instellen voor, dat de toegangscode is ingeschakeld",
"Password": "Wachtwoord",
"Repeat password": "Herhaal wachtwoord",
"Write these words down on an analog and secure place": "Schrijf deze woorden op een analoge en veilige plaats op",
"Without these words, you cannot access your wallet again": "Zonder deze woorden heeft u geen toegang meer tot uw portefeuille",
"Yes, I wrote it down": "Ja, ik heb het opgeschreven",
Expand All @@ -61,10 +56,5 @@ export default {
"Postal Code": "Postcode",
"City": "Stad",
"Country": "Land",
"At least one number needed": "Minimaal één nummer vereist",
"At least one uppercase letter needed": "Minimaal één hoofdletter vereist",
"Passwords do not match": "De wachtwoorden komen niet overeen",
"No spaces allowed": "Spaties zijn niet toegestaan",
"At least 8 characters are required": "Minimaal 8 tekens gebruiken",
"Your Jolocom Wallet": "Uw Jolocom Wallet"
}
1 change: 0 additions & 1 deletion src/routeList.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
export const enum routeList {
Landing = 'Landing',
Consent = 'Consent',
PasswordEntry = 'PasswordEntry',
Entropy = 'Entropy',
Loading = 'Loading',
SeedPhrase = 'SeedPhrase',
Expand Down
8 changes: 1 addition & 7 deletions src/routes.ios.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,7 @@ import { StackNavigator, TabBarTop, TabNavigator } from 'react-navigation'
import { Claims, ClaimDetails } from 'src/ui/home/'
import { Landing } from 'src/ui/landing/'
import { PaymentConsent } from 'src/ui/payment'
import {
PasswordEntry,
SeedPhrase,
Loading,
Entropy,
} from 'src/ui/registration/'
import { SeedPhrase, Loading, Entropy } from 'src/ui/registration/'
import { JolocomTheme } from 'src/styles/jolocom-theme'
import { Exception } from 'src/ui/generic/'
import { Consent } from 'src/ui/sso'
Expand Down Expand Up @@ -79,7 +74,6 @@ export const Routes = StackNavigator({
Landing: { screen: Landing, navigationOptions },
Entropy: { screen: Entropy, navigationOptions },
Loading: { screen: Loading, navigationOptions },
PasswordEntry: { screen: PasswordEntry, navigationOptions },
SeedPhrase: { screen: SeedPhrase, navigationOptions },
Home: { screen: HomeRoutes },
CredentialDialog: {
Expand Down
8 changes: 1 addition & 7 deletions src/routes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,7 @@ import { StackNavigator, TabBarTop, TabNavigator } from 'react-navigation'
import { Claims, Interactions, ClaimDetails } from 'src/ui/home/'
import { Landing } from 'src/ui/landing/'
import { PaymentConsent } from 'src/ui/payment'
import {
PasswordEntry,
SeedPhrase,
Loading,
Entropy,
} from 'src/ui/registration/'
import { SeedPhrase, Loading, Entropy } from 'src/ui/registration/'
import { JolocomTheme } from 'src/styles/jolocom-theme'
import { Exception } from 'src/ui/generic/'
import { Consent } from 'src/ui/sso'
Expand Down Expand Up @@ -85,7 +80,6 @@ export const Routes = StackNavigator({
Landing: { screen: Landing, navigationOptions },
Entropy: { screen: Entropy, navigationOptions },
Loading: { screen: Loading, navigationOptions },
PasswordEntry: { screen: PasswordEntry, navigationOptions },
SeedPhrase: { screen: SeedPhrase, navigationOptions },
Home: { screen: HomeRoutes },
CredentialDialog: {
Expand Down
189 changes: 0 additions & 189 deletions src/ui/registration/components/passwordEntry.tsx

This file was deleted.

Loading

0 comments on commit 2e368a6

Please sign in to comment.