Slight speed up on vpn

Rather than querying bitwarden thrice, which is a slow query, we take
advantage of nushell konwing how to parse JSON output so we can only
query once for the credentials and a second time for the OTP value
This commit is contained in:
Greg Hellings
2025-12-19 10:46:50 -06:00
parent 50aa005349
commit 78637556c7
2 changed files with 5 additions and 6 deletions
+2 -3
View File
@@ -42,10 +42,9 @@ in
def --env vpn [] {
unlock
let username = ^bw get username f7351f9c-b25b-4317-8352-affc00da4644
let password = ^bw get password f7351f9c-b25b-4317-8352-affc00da4644
let login = ^bw get item f7351f9c-b25b-4317-8352-affc00da4644 | from json
let otp = ^bw get totp 10371487-7f40-4b08-9a45-b33e00de318b
osascript ${vpn} $username $"($password)($otp)"
osascript ${vpn} $login.login.username $"($login.login.password)($otp)"
}
'';
settings = {