added check if logged in functions to anilist and simkl
This commit is contained in:
parent
d1258c54d3
commit
7044dc1d90
@ -25,8 +25,16 @@ var aniRing, _ = keyring.Open(keyring.Config{
|
||||
|
||||
var aniCtxShutdown, aniCancel = context.WithCancel(context.Background())
|
||||
|
||||
func (a *App) CheckIfAniListLoggedIn() bool {
|
||||
if (AniListJWT{} == aniListJwt) {
|
||||
return false
|
||||
} else {
|
||||
return true
|
||||
}
|
||||
}
|
||||
|
||||
func (a *App) AniListLogin() {
|
||||
if (AniListJWT{}) == aniListJwt {
|
||||
if a.CheckIfSimklLoggedIn() == false {
|
||||
tokenType, err := aniRing.Get("anilistTokenType")
|
||||
expiresIn, err := aniRing.Get("anilistTokenExpiresIn")
|
||||
accessToken, err := aniRing.Get("anilistAccessToken")
|
||||
|
@ -23,8 +23,16 @@ var simklRing, _ = keyring.Open(keyring.Config{
|
||||
|
||||
var simklCtxShutdown, simklCancel = context.WithCancel(context.Background())
|
||||
|
||||
func (a *App) CheckIfSimklLoggedIn() bool {
|
||||
if (SimklJWT{} == simklJwt) {
|
||||
return false
|
||||
} else {
|
||||
return true
|
||||
}
|
||||
}
|
||||
|
||||
func (a *App) SimklLogin() {
|
||||
if (SimklJWT{}) == simklJwt {
|
||||
if a.CheckIfSimklLoggedIn() == false {
|
||||
tokenType, err := simklRing.Get("SimklTokenType")
|
||||
accessToken, err := simklRing.Get("SimklAccessToken")
|
||||
scope, err := simklRing.Get("SimklScope")
|
||||
|
Loading…
Reference in New Issue
Block a user