Open atompie opened 1 year ago
Can I work on this?
Sure. Sorry for the late response. If you have more questions please do not hesitate to ask them here
@atompie Hello! Wanted to know if what you meant to say was that after login is successful, store the credentials in the object of the described class and then save it to local storage? And is this the file where login is approved https://github.com/Tracardi/tracardi-gui/blob/master/src/components/authentication/SignIn.js?
@developer-diganta Yes it is done here.
const api = loginUser(email, password);
setProgress(true);
api.then(response => {
setToken(response.data['access_token']);
setRoles(response.data['roles']);
setStoredApiUrl(apiUrl);
setRedirectToReferrer(true);
})
See setToken it does the same thing.
Preferences should be returned with the response.
Sorry for confusion this issue is still open. I clicked wrong button.
During login the user preferences are returned; safe them in localStorage. Create a class to easliy access them
set should use the API: https://github.com/Tracardi/tracardi/issues/704