pkg: login session object

Signed-off-by: HeshamTB <hishaminv@gmail.com>
This commit is contained in:
HeshamTB 2025-04-11 08:28:09 +03:00
parent fd94b640a5
commit 41a6f0a1e1
2 changed files with 27 additions and 0 deletions

3
pkg/login/login.go Normal file
View File

@ -0,0 +1,3 @@
package login

View File

@ -57,3 +57,27 @@ type LoginVerificationResponse struct {
RefreshToken string `json:"refreshToken"` RefreshToken string `json:"refreshToken"`
} }
type Login struct {
LoginVerificationResponse
}
func (l *Login) Set(login LoginVerificationResponse) {
l.AccessToken = login.AccessToken
l.TokenType = login.TokenType
l.ExpiresIn = login.ExpiresIn
l.RefreshToken = login.RefreshToken
}
func (l *Login) Load(filename string) {}
func (l *Login) Save(filename string) error { return nil }
func (l *Login) Valid() error { return nil }
func (l *Login) fetchNewAccessToken() error { return nil }
// Save to file
// Try to get previous login
// Ask for new login creds if not
// Test previos login
// Ask for new if not valid