Closed eshin2 closed 1 month ago
@eshin2 fixed the tests, just had to change from Provider
to ChangeNotifierProvider
in each test set up because in your PR you changed the User
class to extend ChangeNotifierProvider
.
This PR just includes a hardcoded username and password, and a hardcoded moodle url - If we want to use this style of logging in, we need to provide the user a way to set this information, like "username", "password", and "moodle url" inputs above the login with moodle button.
Alternatively, we can use OAuth like @WhitneyMeulink was suggesting - however this poses a new set of problems, including but not limited to: we would need a way for the user to set the client_id, client_secret, and base Moodle URL. This plus extra configuration on the part of moodle seems like maybe we should go back to option 1 (log in with username and password) as described above. I won't approve for now, but the changes to the UserProvider and Login Page look good considering we change the things described here.
Added functionality to get token from Moodle using Admin account credentials.