mirror of
https://github.com/nix-community/home-manager.git
synced 2025-12-10 02:51:05 +01:00
aerc-accounts: improve logic for parsing XOAUTH2 URL params (#6530)
This commit fixes an issue in aerc-accounts that prevents oauth2 accounts from being generated from given parameters. It also allows users to add XOAUTH2 credentials without having to add all four of client_id, client_secret, token_endpoint, and scope. It further adds tests for the XOAUTH2 config generation.
This commit is contained in:
parent
74f0a8546e
commit
18e74c2e02
4 changed files with 52 additions and 2 deletions
|
|
@ -134,8 +134,9 @@ in {
|
|||
|
||||
oauthParams = { auth, params }:
|
||||
if useOauth auth && params != null && params != { } then
|
||||
"?" + builtins.concatStringsSep "&" lib.attrsets.mapAttrsToList
|
||||
(k: v: k + "=" + lib.strings.escapeURL v) params
|
||||
"?" + builtins.concatStringsSep "&"
|
||||
(lib.attrsets.mapAttrsToList (k: v: k + "=" + lib.strings.escapeURL v)
|
||||
(lib.attrsets.filterAttrs (k: v: v != null) params))
|
||||
else
|
||||
"";
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue