added MAL Login

This commit is contained in:
2024-08-13 18:54:27 -04:00
parent 43a054ac92
commit fa3304db92
14 changed files with 459 additions and 22 deletions

View File

@ -28,7 +28,7 @@ func (a *App) CheckIfSimklLoggedIn() bool {
tokenType, err := simklRing.Get("SimklTokenType")
accessToken, err := simklRing.Get("SimklAccessToken")
scope, err := simklRing.Get("SimklScope")
if err != nil {
if err != nil || len(accessToken.Data) == 0 {
return false
} else {
simklJwt.TokenType = string(tokenType.Data)
@ -46,7 +46,7 @@ func (a *App) SimklLogin() {
tokenType, err := simklRing.Get("SimklTokenType")
accessToken, err := simklRing.Get("SimklAccessToken")
scope, err := simklRing.Get("SimklScope")
if err != nil {
if err != nil || len(accessToken.Data) == 0 {
getSimklCodeUrl := "https://simkl.com/oauth/authorize?response_type=code&client_id=" + os.Getenv("SIMKL_CLIENT_ID") + "&redirect_uri=" + os.Getenv("SIMKL_CALLBACK_URI")
runtime.BrowserOpenURL(a.ctx, getSimklCodeUrl)