Skip to content
Snippets Groups Projects
Unverified Commit 545b4308 authored by Bruno Michel's avatar Bruno Michel Committed by GitHub
Browse files

Add flat/nested to bitwarden prelogin route (#3544)

parent 833ed68f
Branches
No related tags found
No related merge requests found
......@@ -31,9 +31,9 @@ to `https://<instance>/bitwarden`.
### POST /bitwarden/api/accounts/prelogin
It allows the client to know the number of KDF iterations to apply when hashing
the master password. It can also tell if the login via OIDC is mandatory, and
if the vault is empty (when both conditions are true, the onboarding process is
a bit different).
the master password. It can also tell if the login via OIDC is mandatory, if
the vault is empty (when both conditions are true, the onboarding process is a
bit different), and if flat or nested subdomains are used.
#### Request
......@@ -61,7 +61,8 @@ Content-Type: application/json
"Kdf": 0,
"KdfIterations": 10000,
"OIDC": false,
"HasCiphers": true
"HasCiphers": true,
"FlatSubdomains": true
}
```
......
......@@ -50,11 +50,13 @@ func Prelogin(c echo.Context) error {
if resp, err := couchdb.NormalDocs(inst, consts.BitwardenCiphers, 0, 1, "", false); err == nil {
hasCiphers = resp.Total > 0
}
flat := config.GetConfig().Subdomains == config.FlatSubdomains
return c.JSON(http.StatusOK, echo.Map{
"Kdf": setting.PassphraseKdf,
"KdfIterations": setting.PassphraseKdfIterations,
"OIDC": !passwordAuth,
"HasCiphers": hasCiphers,
"Kdf": setting.PassphraseKdf,
"KdfIterations": setting.PassphraseKdfIterations,
"OIDC": !passwordAuth,
"HasCiphers": hasCiphers,
"FlatSubdomains": flat,
})
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment