added check if logged in functions to anilist and simkl

This commit is contained in:
John O'Keefe 2024-07-30 13:07:30 -04:00
parent d1258c54d3
commit 7044dc1d90
2 changed files with 18 additions and 2 deletions

View File

@ -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")

View File

@ -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")