mirror of
https://github.com/freqtrade/frequi.git
synced 2024-11-10 18:23:50 +00:00
Fix userlogin migration
This commit is contained in:
parent
f4ccf31b6f
commit
c2a1f9cf3b
|
@ -186,7 +186,7 @@ export class UserService {
|
||||||
/**
|
/**
|
||||||
* Call on startup to migrate old login info to new login
|
* Call on startup to migrate old login info to new login
|
||||||
*/
|
*/
|
||||||
public migrateLogin() {
|
public static migrateLogin() {
|
||||||
// TODO: this is actually never called!
|
// TODO: this is actually never called!
|
||||||
const AUTH_REFRESH_TOKEN = 'auth_ref_token'; // Legacy key - do not use
|
const AUTH_REFRESH_TOKEN = 'auth_ref_token'; // Legacy key - do not use
|
||||||
const AUTH_ACCESS_TOKEN = 'auth_access_token';
|
const AUTH_ACCESS_TOKEN = 'auth_access_token';
|
||||||
|
@ -209,7 +209,8 @@ export class UserService {
|
||||||
accessToken,
|
accessToken,
|
||||||
autoRefresh,
|
autoRefresh,
|
||||||
};
|
};
|
||||||
this.storeLoginInfo(loginInfo);
|
const x = new UserService('ftbot.0');
|
||||||
|
x.storeLoginInfo(loginInfo);
|
||||||
}
|
}
|
||||||
|
|
||||||
localStorage.removeItem(AUTH_REFRESH_TOKEN);
|
localStorage.removeItem(AUTH_REFRESH_TOKEN);
|
||||||
|
@ -221,6 +222,5 @@ export class UserService {
|
||||||
|
|
||||||
export function useUserService(botId: string) {
|
export function useUserService(botId: string) {
|
||||||
const userservice = new UserService(botId);
|
const userservice = new UserService(botId);
|
||||||
userservice.migrateLogin();
|
|
||||||
return userservice;
|
return userservice;
|
||||||
}
|
}
|
||||||
|
|
|
@ -72,6 +72,8 @@ const store = new Vuex.Store({
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
|
UserService.migrateLogin();
|
||||||
|
|
||||||
store.registerModule('ftbot', createBotStore(store));
|
store.registerModule('ftbot', createBotStore(store));
|
||||||
Object.entries(UserService.getAvailableBots()).forEach(([k, v]) => {
|
Object.entries(UserService.getAvailableBots()).forEach(([k, v]) => {
|
||||||
store.dispatch('ftbot/addBot', v);
|
store.dispatch('ftbot/addBot', v);
|
||||||
|
|
Loading…
Reference in New Issue
Block a user