@@ -81,10 +81,11 @@ function cmd.cookie_prompt(cb)
81
81
end
82
82
83
83
function cmd .sign_out ()
84
+ cmd .menu ()
85
+
84
86
log .warn (" You're now signed out" )
85
87
cmd .delete_cookie ()
86
88
cmd .set_menu_page (" signin" )
87
- cmd .q_close_all ()
88
89
end
89
90
90
91
--- Sign out
@@ -119,9 +120,7 @@ cmd.expire = vim.schedule_wrap(function()
119
120
end
120
121
log .info (" Successful re-login" )
121
122
else
122
- cmd .delete_cookie ()
123
- cmd .set_menu_page (" signin" )
124
- cmd .q_close_all ()
123
+ cmd .sign_out ()
125
124
end
126
125
end )
127
126
end )
359
358
360
359
function cmd .restore ()
361
360
local utils = require (" leetcode.utils" )
362
- utils .auth_guard ()
363
361
local q = utils .curr_question ()
364
362
if not q then
365
363
return
385
383
386
384
function cmd .inject ()
387
385
local utils = require (" leetcode.utils" )
388
- utils .auth_guard ()
389
386
local q = utils .curr_question ()
390
387
if not q then
391
388
return
@@ -439,6 +436,8 @@ function cmd.get_session_by_name(name)
439
436
end
440
437
441
438
function cmd .change_session (opts )
439
+ require (" leetcode.utils" ).auth_guard ()
440
+
442
441
local name = opts .name [1 ] or config .sessions .default
443
442
444
443
local session = cmd .get_session_by_name (name )
@@ -457,6 +456,8 @@ function cmd.change_session(opts)
457
456
end
458
457
459
458
function cmd .create_session (opts )
459
+ require (" leetcode.utils" ).auth_guard ()
460
+
460
461
local name = opts .name [1 ]
461
462
if not name then
462
463
return log .error (" Session name not provided" )
@@ -472,6 +473,8 @@ function cmd.create_session(opts)
472
473
end
473
474
474
475
function cmd .update_sessions ()
476
+ require (" leetcode.utils" ).auth_guard ()
477
+
475
478
config .stats .update_sessions ()
476
479
end
477
480
0 commit comments