@@ -81,10 +81,11 @@ function cmd.cookie_prompt(cb)
8181end
8282
8383function cmd .sign_out ()
84+ cmd .menu ()
85+
8486 log .warn (" You're now signed out" )
8587 cmd .delete_cookie ()
8688 cmd .set_menu_page (" signin" )
87- cmd .q_close_all ()
8889end
8990
9091--- Sign out
@@ -119,9 +120,7 @@ cmd.expire = vim.schedule_wrap(function()
119120 end
120121 log .info (" Successful re-login" )
121122 else
122- cmd .delete_cookie ()
123- cmd .set_menu_page (" signin" )
124- cmd .q_close_all ()
123+ cmd .sign_out ()
125124 end
126125 end )
127126end )
359358
360359function cmd .restore ()
361360 local utils = require (" leetcode.utils" )
362- utils .auth_guard ()
363361 local q = utils .curr_question ()
364362 if not q then
365363 return
385383
386384function cmd .inject ()
387385 local utils = require (" leetcode.utils" )
388- utils .auth_guard ()
389386 local q = utils .curr_question ()
390387 if not q then
391388 return
@@ -439,6 +436,8 @@ function cmd.get_session_by_name(name)
439436end
440437
441438function cmd .change_session (opts )
439+ require (" leetcode.utils" ).auth_guard ()
440+
442441 local name = opts .name [1 ] or config .sessions .default
443442
444443 local session = cmd .get_session_by_name (name )
@@ -457,6 +456,8 @@ function cmd.change_session(opts)
457456end
458457
459458function cmd .create_session (opts )
459+ require (" leetcode.utils" ).auth_guard ()
460+
460461 local name = opts .name [1 ]
461462 if not name then
462463 return log .error (" Session name not provided" )
@@ -472,6 +473,8 @@ function cmd.create_session(opts)
472473end
473474
474475function cmd .update_sessions ()
476+ require (" leetcode.utils" ).auth_guard ()
477+
475478 config .stats .update_sessions ()
476479end
477480
0 commit comments