diff --git a/src/Component/Auth/__action/authentication.js b/src/Component/Auth/__action/authentication.js index 8ab0c8e..75bab5e 100644 --- a/src/Component/Auth/__action/authentication.js +++ b/src/Component/Auth/__action/authentication.js @@ -8,10 +8,10 @@ import {tokenToHeaders} from "../../../setup/utility/tokenToHeaders"; /** * authentication - * this method do two action. validation token and get user details and set to redux. + * this method does two actions: validate the token and get the user details and set to redux. * * @param token : user authentication key. like "eyJ0eXAiOiJKV1QiLCJhbGciOiJ...." - * @returns {Promise}: when user is valid do then and when invalid do catch + * @returns {Promise}: when user is valid, do then and when it is invalid, do catch */ export const authentication = (token) => { return axios({ @@ -19,7 +19,7 @@ export const authentication = (token) => { token: tokenToHeaders({}, token) }) .then((response) => { - // token is valid and user details ready to use + // token is valid and user details are ready to use setStore({ localUser: { updated: true, @@ -29,7 +29,7 @@ export const authentication = (token) => { }); }) .catch((e) => { - // token is invalid or occur an error + // token is invalid or an error occured signingOut(); toast.error('authentication error. please log in again.'); console.error(e);