-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Who is maintaining what branch of Magister v2? #2
Comments
FWIW I've just released the first alpha version of magister.js v2 You can install it by using This package isn't affiliated with Magister.js (it's completely newly written), but it may be a better alternative since it's actually maintained. I don't really know if @idiidk would rather continue on his own library or take over Magister.js. But that's up to him of course :) |
Just to clarify, I totally would like to continue with magister.js and just deprecate this package. To get to the point where MagisterJS already is would take a pretty long time so it would just be wasted effort. |
Ikr. I think that the best option too. Weet je of magister.js ook een optie heeft om de auth data op te slaan zodat je later kan reautenticaten? |
Ok, that is super! I will try to keep using magister.js v2 then :) Great that you are willing to maintain it by the way 👍 |
@Sj3rd Save the bearer token from the Magister object and reauthenticate with that token. If it's expired the login will just fail I guess. |
@idiidk but how can I reauthenticate with the bearer token I got the bearertoken by calling the login function |
@Sj3rd Set the parameter token on login {token: "IDIIDK"} |
@idiidk But how do I call the login() function when there's no one logged in? |
@Sj3rd getSchools('<schoolname>') // get schools matching '<schoolname>'
.then((schools) => schools[0]) // get the first school
.then((school) => magister({ // login
school,
token: "THis?"
}))
.then((m) => { // done logging in, say hi
console.log(`Hey ${m.profileInfo.firstName}!`);
}, (err) => { // something went wrong
console.error('something went wrong:', err);
}); |
@idiidk wat raar, ik krijg gewoon terug wat je zou verwachten (school, bearer etc), alleen de is profileInfo leeg, waardoor de api dus ook niet de privileges kan lezen en geen requests naar magister kan doen... |
@idiidk @Sj3rd what is the benefit of re-authenticating with a token versus just logging in again with username/password? |
@gruijter Storing a token is a lot safer than just storing a plain password, but in your situation you probably still need to do that because tokens expire. We probably need to add token refreshing to MagisterJS to fully get rid of password storing. |
Hi @idiidk
Great to see you have added the new authentication scheme, and that you have published it as an npm package! I am however confused where the magister v2 is being maintained now. See also this issue:
simplyGits/MagisterJS#76
Note: the 'original' v2 has recently gotten some commits by @lieuwex. Could you please align with him on where/how to maintain this package?
I do like to see all commits being published as npm package!
The text was updated successfully, but these errors were encountered: