Skip to content

Commit

Permalink
Do not create a Subsonic API key by default for new users
Browse files Browse the repository at this point in the history
  • Loading branch information
epoupon committed Dec 18, 2024
1 parent 5c73b5b commit 080a068
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/lms/ui/admin/UserView.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -102,13 +102,15 @@ namespace lms::ui
user = LmsApp->getDbSession().create<User>(valueText(LoginField).toUTF8());

if (Wt::asNumber(value(DemoField)))
{
user.modify()->setType(UserType::DEMO);

// For demo user, we create the subsonic API auth token now as we have no other mean to create it later
core::Service<auth::IAuthTokenService>::get()->createAuthToken("subsonic", user->getId(), core::UUID::generate().getAsString());
}

if (_authPasswordService)
_authPasswordService->setPassword(user->getId(), valueText(PasswordField).toUTF8());

// For demo user, we create the subsonic API auth token now as we have no other mean to create it later
core::Service<auth::IAuthTokenService>::get()->createAuthToken("subsonic", user->getId(), core::UUID::generate().getAsString());
}
}

Expand Down

0 comments on commit 080a068

Please sign in to comment.