Tree Browser Work
This commit is contained in:
@@ -96,6 +96,20 @@ func (m *SqliteStore) GetSession(ctx context.Context, did syntax.DID, sessionID
|
||||
return &row.Data, nil
|
||||
}
|
||||
|
||||
func (m *SqliteStore) GetMostRecentSessionFor(ctx context.Context, did syntax.DID) (*oauth.ClientSessionData, error) {
|
||||
var row storedSessionData
|
||||
res := m.db.WithContext(ctx).Where(&storedSessionData{
|
||||
AccountDid: did,
|
||||
}).Order(clause.OrderByColumn{
|
||||
Column: clause.Column{Name: "updated_at"},
|
||||
Desc: true,
|
||||
}).First(&row)
|
||||
if res.Error != nil {
|
||||
return nil, res.Error
|
||||
}
|
||||
return &row.Data, nil
|
||||
}
|
||||
|
||||
// not part of the ClientAuthStore interface, just used for the CLI app
|
||||
func (m *SqliteStore) GetMostRecentSession(ctx context.Context) (*oauth.ClientSessionData, error) {
|
||||
var row storedSessionData
|
||||
|
||||
Reference in New Issue
Block a user