Commit 2689b61 Corentin Mors
authored
1 parent f74fb06 commit 2689b61 Copy full SHA for 2689b61
File tree 1 file changed +6
-1
lines changed
1 file changed +6
-1
lines changed Original file line number Diff line number Diff line change @@ -40,7 +40,7 @@ export const connectAndPrepare = async (
40
40
db . serialize ( ) ;
41
41
42
42
// Create the tables and load the deviceConfiguration if it exists
43
- const deviceConfiguration = prepareDB ( { db } ) ;
43
+ let deviceConfiguration = prepareDB ( { db } ) ;
44
44
if ( failIfNoDB && ! deviceConfiguration ) {
45
45
throw new Error ( 'No device registered in the database' ) ;
46
46
}
@@ -51,6 +51,11 @@ export const connectAndPrepare = async (
51
51
shouldNotSaveMasterPasswordIfNoDeviceKeys
52
52
) ;
53
53
54
+ // if the device was created for the first time we need to get the device credentials again
55
+ if ( ! deviceConfiguration ) {
56
+ deviceConfiguration = prepareDB ( { db } ) ;
57
+ }
58
+
54
59
if ( deviceConfiguration && deviceConfiguration . version !== cliVersionToString ( CLI_VERSION ) ) {
55
60
const version = stringToCliVersion ( deviceConfiguration . version ) ;
56
61
You can’t perform that action at this time.
0 commit comments