diff --git a/client/client.go b/client/client.go index d54828b..5a097e3 100644 --- a/client/client.go +++ b/client/client.go @@ -16,8 +16,6 @@ type LogtoConfig struct { Scopes []string Resources []string Prompt string - // TODO: Find a way to make this value default to true - PersistAccessToken bool } type AccessToken struct { @@ -41,9 +39,7 @@ func NewLogtoClient(config *LogtoConfig, storage Storage) *LogtoClient { accessTokenMap: make(map[string]AccessToken), } - if config.PersistAccessToken { - logtoClient.loadAccessTokenMap() - } + logtoClient.loadAccessTokenMap() return &logtoClient } @@ -77,9 +73,7 @@ func (logtoClient *LogtoClient) GetIdTokenClaims() (core.IdTokenClaims, error) { func (logtoClient *LogtoClient) SaveAccessToken(key string, accessToken AccessToken) { logtoClient.accessTokenMap[key] = accessToken - if logtoClient.logtoConfig.PersistAccessToken { - logtoClient.persistAccessTokenMap() - } + logtoClient.persistAccessTokenMap() } func (logtoClient *LogtoClient) GetAccessToken(resource string) (AccessToken, error) { diff --git a/gin-sample/main.go b/gin-sample/main.go index 061a134..23e6837 100644 --- a/gin-sample/main.go +++ b/gin-sample/main.go @@ -15,11 +15,10 @@ var ( func main() { logtoConfig := &client.LogtoConfig{ - Endpoint: "http://localhost:3001", - AppId: "wkMqPInVTZL0Ys4K3POl7", - AppSecret: "71kbRPQ1NAVA08IBStipz", - Resources: []string{"https://api.logto.io"}, - PersistAccessToken: true, + Endpoint: "http://localhost:3001", + AppId: "wkMqPInVTZL0Ys4K3POl7", + AppSecret: "71kbRPQ1NAVA08IBStipz", + Resources: []string{"https://api.logto.io"}, } store := memstore.NewStore([]byte("secret"))