|
@@ -68,7 +68,7 @@ export default class CustomScheme extends LocalScheme {
|
|
|
this.options.endpoints.login,
|
|
|
);
|
|
|
this.updateTokens(response);
|
|
|
- localStorage.setItem('auth.username', response.data.data.username);
|
|
|
+ // localStorage.setItem('auth.username', response.data.data.username);
|
|
|
|
|
|
if (!this.requestHandler.interceptor) {
|
|
|
this.initializeRequestInterceptor();
|
|
@@ -79,37 +79,37 @@ export default class CustomScheme extends LocalScheme {
|
|
|
return response;
|
|
|
}
|
|
|
|
|
|
- fetchUser(endpoint) {
|
|
|
- console.log(
|
|
|
- '🚀 ~ file: password.js ~ line 83 ~ CustomScheme ~ fetchUser ~ endpoint',
|
|
|
- endpoint,
|
|
|
- );
|
|
|
- if (!this.check().valid) {
|
|
|
- return Promise.resolve();
|
|
|
- }
|
|
|
- if (!this.options.endpoints.user) {
|
|
|
- this.$auth.setUser({});
|
|
|
- return Promise.resolve();
|
|
|
- }
|
|
|
- return this.$auth
|
|
|
- .requestWith(this.name, endpoint, this.options.endpoints.user)
|
|
|
- .then((response) => {
|
|
|
- const userData = getProp(response.data, this.options.user.property);
|
|
|
+ // fetchUser(endpoint) {
|
|
|
+ // console.log(
|
|
|
+ // '🚀 ~ file: password.js ~ line 83 ~ CustomScheme ~ fetchUser ~ endpoint',
|
|
|
+ // endpoint,
|
|
|
+ // );
|
|
|
+ // if (!this.check().valid) {
|
|
|
+ // return Promise.resolve();
|
|
|
+ // }
|
|
|
+ // if (!this.options.endpoints.user) {
|
|
|
+ // this.$auth.setUser({});
|
|
|
+ // return Promise.resolve();
|
|
|
+ // }
|
|
|
+ // return this.$auth
|
|
|
+ // .requestWith(this.name, endpoint, this.options.endpoints.user)
|
|
|
+ // .then((response) => {
|
|
|
+ // const userData = getProp(response.data, this.options.user.property);
|
|
|
|
|
|
- userData.username = localStorage.getItem('auth.username');
|
|
|
+ // userData.username = localStorage.getItem('auth.username');
|
|
|
|
|
|
- if (!userData) {
|
|
|
- const error = new Error(
|
|
|
- `User Data response does not contain field ${this.options.user.property}`,
|
|
|
- );
|
|
|
- return Promise.reject(error);
|
|
|
- }
|
|
|
- this.$auth.setUser(userData);
|
|
|
- return response;
|
|
|
- })
|
|
|
- .catch((error) => {
|
|
|
- this.$auth.callOnError(error, { method: 'fetchUser' });
|
|
|
- return Promise.reject(error);
|
|
|
- });
|
|
|
- }
|
|
|
+ // if (!userData) {
|
|
|
+ // const error = new Error(
|
|
|
+ // `User Data response does not contain field ${this.options.user.property}`,
|
|
|
+ // );
|
|
|
+ // return Promise.reject(error);
|
|
|
+ // }
|
|
|
+ // this.$auth.setUser(userData);
|
|
|
+ // return response;
|
|
|
+ // })
|
|
|
+ // .catch((error) => {
|
|
|
+ // this.$auth.callOnError(error, { method: 'fetchUser' });
|
|
|
+ // return Promise.reject(error);
|
|
|
+ // });
|
|
|
+ // }
|
|
|
}
|