Skip to content

A local-first personal finance app

🐛 Fix for var `ACTUAL_OPENID_ENFORCE` (#4533)

lelemm42294d4a53de
diff --git a/packages/desktop-client/src/components/manager/subscribe/Login.tsx b/packages/desktop-client/src/components/manager/subscribe/Login.tsx
index 34c2ad0bd9..f8209db0ef 100644
--- a/packages/desktop-client/src/components/manager/subscribe/Login.tsx
+++ b/packages/desktop-client/src/components/manager/subscribe/Login.tsx
@@ -220,6 +220,10 @@ export function Login() {
const { checked } = useBootstrapped();
const loginMethods = useAvailableLoginMethods();
+ useEffect(() => {
+ setMethod(defaultLoginMethod);
+ }, [defaultLoginMethod]);
+
useEffect(() => {
if (checked && !searchParams.has('error')) {
(async () => {
diff --git a/packages/sync-server/src/app-account.js b/packages/sync-server/src/app-account.js
index 8809189013..5bc978856a 100644
--- a/packages/sync-server/src/app-account.js
+++ b/packages/sync-server/src/app-account.js
@@ -30,12 +30,16 @@ export { app as handlers };
// /login
app.get('/needs-bootstrap', (req, res) => {
+ const availableLoginMethods = listLoginMethods();
res.send({
status: 'ok',
data: {
bootstrapped: !needsBootstrap(),
- loginMethod: getLoginMethod(),
- availableLoginMethods: listLoginMethods(),
+ loginMethod:
+ availableLoginMethods.length === 1
+ ? availableLoginMethods[0].method
+ : getLoginMethod(),
+ availableLoginMethods,
multiuser: getActiveLoginMethod() === 'openid',
},
});
diff --git a/upcoming-release-notes/4533.md b/upcoming-release-notes/4533.md
new file mode 100644
index 0000000000..b54dfedcba
--- /dev/null
+++ b/upcoming-release-notes/4533.md
@@ -0,0 +1,6 @@
+---
+category: Bugfix
+authors: [lelemm]
+---
+
+Fix for variable `ACTUAL_OPENID_ENFORCE`. OpenID was not being enforced at some conditions.