mirror of
https://github.com/quexten/goldwarden.git
synced 2025-02-03 13:28:37 +01:00
Fix login-with-device approval
This commit is contained in:
parent
e840b22145
commit
31cf9746d5
@ -63,10 +63,10 @@ func CreateAuthResponse(ctx context.Context, authRequest AuthRequestData, keyrin
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
return authRequestResponse, err
|
return authRequestResponse, err
|
||||||
}
|
}
|
||||||
masterPasswordHash, err := config.GetMasterPasswordHash()
|
//masterPasswordHash, err := config.GetMasterPasswordHash()
|
||||||
if err != nil {
|
//if err != nil {
|
||||||
return authRequestResponse, err
|
// return authRequestResponse, err
|
||||||
}
|
//}
|
||||||
|
|
||||||
publicKey, err := base64.StdEncoding.DecodeString(authRequest.PublicKey)
|
publicKey, err := base64.StdEncoding.DecodeString(authRequest.PublicKey)
|
||||||
requesterKey, err := crypto.AssymmetricEncryptionKeyFromBytes(publicKey)
|
requesterKey, err := crypto.AssymmetricEncryptionKeyFromBytes(publicKey)
|
||||||
@ -75,16 +75,15 @@ func CreateAuthResponse(ctx context.Context, authRequest AuthRequestData, keyrin
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
panic(err)
|
panic(err)
|
||||||
}
|
}
|
||||||
encryptedMasterPasswordHash, err := crypto.EncryptWithAsymmetric(masterPasswordHash, requesterKey)
|
//encryptedMasterPasswordHash, err := crypto.EncryptWithAsymmetric(masterPasswordHash, requesterKey)
|
||||||
if err != nil {
|
//if err != nil {
|
||||||
panic(err)
|
// panic(err)
|
||||||
}
|
//}
|
||||||
|
|
||||||
err = authenticatedHTTPPut(ctx, config.ConfigFile.ApiUrl+"/auth-requests/"+authRequest.ID, &authRequestResponse, AuthRequestResponseData{
|
err = authenticatedHTTPPut(ctx, config.ConfigFile.ApiUrl+"/auth-requests/"+authRequest.ID, &authRequestResponse, AuthRequestResponseData{
|
||||||
DeviceIdentifier: config.ConfigFile.DeviceUUID,
|
DeviceIdentifier: config.ConfigFile.DeviceUUID,
|
||||||
Key: string(encryptedUserSymmetricKey),
|
Key: string(encryptedUserSymmetricKey),
|
||||||
MasterPasswordHash: string(encryptedMasterPasswordHash),
|
Requestapproved: true,
|
||||||
Requestapproved: true,
|
|
||||||
})
|
})
|
||||||
return authRequestResponse, err
|
return authRequestResponse, err
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user