aboutsummaryrefslogtreecommitdiff
path: root/mal
diff options
context:
space:
mode:
authorVidhu Kant Sharma <vidhukant@vidhukant.xyz>2022-08-14 21:06:32 +0530
committerVidhu Kant Sharma <vidhukant@vidhukant.xyz>2022-08-14 21:06:32 +0530
commitd7a820b1115a3765daecf05b13a8caa94f432e85 (patch)
tree430bb067432e61baf5982bfb68b3463fd6f0f8c5 /mal
parent1ae40030b32f9ab70fdc9a06161b32632168597f (diff)
reading auth token from flags
Diffstat (limited to 'mal')
-rw-r--r--mal/mal.go7
1 files changed, 5 insertions, 2 deletions
diff --git a/mal/mal.go b/mal/mal.go
index cb9665e..77940df 100644
--- a/mal/mal.go
+++ b/mal/mal.go
@@ -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