MCPcopy
hub / github.com/tinyauthapp/tinyauth / CreateSession

Method CreateSession

internal/repository/session_queries.sql.go:45–74  ·  view source on GitHub ↗
(ctx context.Context, arg CreateSessionParams)

Source from the content-addressed store, hash-verified

43}
44
45func (q *Queries) CreateSession(ctx context.Context, arg CreateSessionParams) (Session, error) {
46 row := q.db.QueryRowContext(ctx, createSession,
47 arg.UUID,
48 arg.Username,
49 arg.Email,
50 arg.Name,
51 arg.Provider,
52 arg.TotpPending,
53 arg.OAuthGroups,
54 arg.Expiry,
55 arg.CreatedAt,
56 arg.OAuthName,
57 arg.OAuthSub,
58 )
59 var i Session
60 err := row.Scan(
61 &i.UUID,
62 &i.Username,
63 &i.Email,
64 &i.Name,
65 &i.Provider,
66 &i.TotpPending,
67 &i.OAuthGroups,
68 &i.Expiry,
69 &i.CreatedAt,
70 &i.OAuthName,
71 &i.OAuthSub,
72 )
73 return i, err
74}
75
76const deleteExpiredSessions = `-- name: DeleteExpiredSessions :exec
77DELETE FROM "sessions"

Callers 1

CreateSessionCookieMethod · 0.80

Calls 1

QueryRowContextMethod · 0.80

Tested by

no test coverage detected