File tree Expand file tree Collapse file tree 2 files changed +4
-1
lines changed
Expand file tree Collapse file tree 2 files changed +4
-1
lines changed Original file line number Diff line number Diff line change @@ -56,7 +56,7 @@ struct TmcCore {
5656// TODO: cache API results?
5757impl TmcClient {
5858 /// Convenience function for checking authentication.
59- fn require_authentication ( & self ) -> Result < ( ) , ClientError > {
59+ pub fn require_authentication ( & self ) -> Result < ( ) , ClientError > {
6060 if self . 0 . token . is_some ( ) {
6161 Ok ( ( ) )
6262 } else {
Original file line number Diff line number Diff line change @@ -208,6 +208,7 @@ pub fn paste_exercise(
208208}
209209
210210/// Downloads the given exercises, by either downloading the exercise template, updating the exercise or downloading an old submission.
211+ /// Requires authentication.
211212/// If the exercise doesn't exist on disk yet...
212213/// if there are previous submissions and download_template is not set, the latest submission is downloaded.
213214/// otherwise, the exercise template is downloaded.
@@ -223,6 +224,8 @@ pub fn download_or_update_course_exercises(
223224 projects_dir. display( )
224225 ) ;
225226
227+ client. require_authentication ( ) ?;
228+
226229 let exercises_details = client. get_exercises_details ( exercises) ?;
227230 let projects_config = ProjectsConfig :: load ( projects_dir) ?;
228231
You can’t perform that action at this time.
0 commit comments