From 90337fab915e4dfa7c2fbaf164ae5128280de279 Mon Sep 17 00:00:00 2001 From: Barrett Ruth Date: Thu, 5 Mar 2026 15:11:08 -0500 Subject: [PATCH] fix(credentials): use display names in login/logout prompts Problem: prompts showed the raw platform key (e.g. "codeforces") instead of the proper display name (e.g. "CodeForces"). Solution: use `PLATFORM_DISPLAY_NAMES` for the username/password prompts and the logout confirmation message. --- lua/cp/credentials.lua | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/lua/cp/credentials.lua b/lua/cp/credentials.lua index 5877a90..031b464 100644 --- a/lua/cp/credentials.lua +++ b/lua/cp/credentials.lua @@ -23,13 +23,13 @@ function M.login(platform) local display = constants.PLATFORM_DISPLAY_NAMES[platform] or platform - vim.ui.input({ prompt = platform .. ' username: ' }, function(username) + vim.ui.input({ prompt = display .. ' username: ' }, function(username) if not username or username == '' then logger.log('Cancelled', { level = vim.log.levels.WARN }) return end vim.fn.inputsave() - local password = vim.fn.inputsecret(platform .. ' password: ') + local password = vim.fn.inputsecret(display .. ' password: ') vim.fn.inputrestore() if not password or password == '' then logger.log('Cancelled', { level = vim.log.levels.WARN }) @@ -77,9 +77,10 @@ function M.logout(platform) ) return end + local display = constants.PLATFORM_DISPLAY_NAMES[platform] or platform cache.load() cache.clear_credentials(platform) - logger.log(platform .. ' credentials cleared', { level = vim.log.levels.INFO, override = true }) + logger.log(display .. ' credentials cleared', { level = vim.log.levels.INFO, override = true }) end return M