added functions to save credentials after successful signup or login