diff options
author | Vidhu Kant Sharma <vidhukant@vidhukant.xyz> | 2022-08-14 21:06:32 +0530 |
---|---|---|
committer | Vidhu Kant Sharma <vidhukant@vidhukant.xyz> | 2022-08-14 21:06:32 +0530 |
commit | d7a820b1115a3765daecf05b13a8caa94f432e85 (patch) | |
tree | 430bb067432e61baf5982bfb68b3463fd6f0f8c5 /mal/mal.go | |
parent | 1ae40030b32f9ab70fdc9a06161b32632168597f (diff) |
reading auth token from flags
Diffstat (limited to 'mal/mal.go')
-rw-r--r-- | mal/mal.go | 7 |
1 files changed, 5 insertions, 2 deletions
@@ -28,6 +28,7 @@ import ( ) var ( + Secret string animeClient a.Client mangaClient m.Client userClient u.Client @@ -40,8 +41,10 @@ var ( // init() would kill the program prematurely on `macli login` command func Init() { - secret := auth.GetToken() - tk := "Bearer " + secret + if Secret == "" { + Secret = auth.GetToken() + } + tk := "Bearer " + Secret // initialise MAL2Go Client(s) animeClient.AuthToken = tk |