mirror of
https://github.com/Nezumi-2711/javascript-training.git
synced 2026-09-22 20:01:31 +00:00
Add constant for local storage key value
This commit is contained in:
@@ -11,9 +11,15 @@ export const MESSAGE = {
|
||||
DEFAULT_TITLE_ERROR_POPUP: 'Error',
|
||||
USER_EXIST_ERROR: 'User is exists! Please try another email!',
|
||||
};
|
||||
|
||||
export const BTN_CONTENT = {
|
||||
GOT_IT: 'Got it!',
|
||||
OK: 'Ok',
|
||||
};
|
||||
|
||||
export const LOCAL_STORAGE = {
|
||||
ACCESS_TOKEN: 'accessToken',
|
||||
};
|
||||
|
||||
export const TYPE_POPUP = { success: 'success', error: 'error' };
|
||||
export const MARK_ICON = { success: 'check', error: 'error' };
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
import { LOCAL_STORAGE } from '../constants/constant';
|
||||
import { createToken } from '../helpers/helpers';
|
||||
import CommonService from './commonService';
|
||||
import LocalStorageService from './localStorageService';
|
||||
@@ -81,6 +82,9 @@ export default class UserService extends CommonService {
|
||||
this.save(newUserData);
|
||||
|
||||
// Add access token to local storage
|
||||
LocalStorageService.add('accessToken', newUserData.accessToken);
|
||||
LocalStorageService.add(
|
||||
LOCAL_STORAGE.ACCESS_TOKEN,
|
||||
newUserData.accessToken,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user