2022-03-19 17:41:27 +05:30
|
|
|
package provider_template
|
|
|
|
|
|
|
|
import (
|
2022-07-10 21:49:33 +05:30
|
|
|
"context"
|
2022-03-19 17:41:27 +05:30
|
|
|
"time"
|
|
|
|
|
|
|
|
"github.com/authorizerdev/authorizer/server/db/models"
|
|
|
|
"github.com/google/uuid"
|
|
|
|
)
|
|
|
|
|
|
|
|
// AddSession to save session information in database
|
2023-07-31 16:42:11 +05:30
|
|
|
func (p *provider) AddSession(ctx context.Context, session *models.Session) error {
|
2022-03-19 17:41:27 +05:30
|
|
|
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 21:49:33 +05:30
|
|
|
func (p *provider) DeleteSession(ctx context.Context, userId string) error {
|
2022-03-19 17:41:27 +05:30
|
|
|
return nil
|
|
|
|
}
|