diff options
author | Vidhu Kant Sharma <vidhukant@vidhukant.xyz> | 2022-07-02 14:41:18 +0530 |
---|---|---|
committer | Vidhu Kant Sharma <vidhukant@vidhukant.xyz> | 2022-07-02 14:41:18 +0530 |
commit | 720045d9ea2e612ca0f0b7333ee62a73b2955a15 (patch) | |
tree | b25bfecc256408b7fbef71abc2964d439ca6d3bb /mal | |
parent | beacbdf5974ab4eadc2ab651ed59b7bd2dcc6e02 (diff) |
Bug Fix: `macli login` showing error message that user is not logged in
Diffstat (limited to 'mal')
-rw-r--r-- | mal/mal.go | 14 |
1 files changed, 8 insertions, 6 deletions
@@ -33,13 +33,15 @@ var userClient u.Client var userAnimeClient ua.Client var userMangaClient um.Client -func init() { +// init() would kill the program prematurely on `macli login` command +func Init() { secret := auth.GetToken() + tk := "Bearer " + secret // initialise MAL2Go Client(s) - animeClient.AuthToken = "Bearer " + secret - mangaClient.AuthToken = "Bearer " + secret - userClient.AuthToken = "Bearer " + secret - userAnimeClient.AuthToken = "Bearer " + secret - userMangaClient.AuthToken = "Bearer " + secret + animeClient.AuthToken = tk + mangaClient.AuthToken = tk + userClient.AuthToken = tk + userAnimeClient.AuthToken = tk + userMangaClient.AuthToken = tk } |