2022-03-19 12:11:27 +00:00
|
|
|
package provider_template
|
|
|
|
|
|
|
|
import (
|
2022-07-10 16:19:33 +00:00
|
|
|
"context"
|
2022-03-19 12:11:27 +00:00
|
|
|
"time"
|
|
|
|
|
|
|
|
"github.com/authorizerdev/authorizer/server/db/models"
|
|
|
|
"github.com/google/uuid"
|
|
|
|
)
|
|
|
|
|
|
|
|
// AddSession to save session information in database
|
2022-07-10 16:19:33 +00:00
|
|
|
func (p *provider) AddSession(ctx context.Context, session models.Session) error {
|
2022-03-19 12:11:27 +00:00
|
|
|
if session.ID == "" {
|
|
|
|
session.ID = uuid.New().String()
|
|
|
|
}
|
|
|
|
|
|
|
|
session.CreatedAt = time.Now().Unix()
|
|
|
|
session.UpdatedAt = time.Now().Unix()
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
|
|
|
|
// DeleteSession to delete session information from database
|
2022-07-10 16:19:33 +00:00
|
|
|
func (p *provider) DeleteSession(ctx context.Context, userId string) error {
|
2022-03-19 12:11:27 +00:00
|
|
|
return nil
|
|
|
|
}
|