MCPcopy Create free account
hub / github.com/dnote/dnote / login

Function login

pkg/e2e/sync/testutils.go:163–168  ·  view source on GitHub ↗

login logs in the user in CLI

(t *testing.T, db *cliDatabase.DB, serverDB *gorm.DB, user database.User)

Source from the content-addressed store, hash-verified

161
162// login logs in the user in CLI
163func login(t *testing.T, db *cliDatabase.DB, serverDB *gorm.DB, user database.User) {
164 session := apitest.SetupSession(serverDB, user)
165
166 cliDatabase.MustExec(t, "inserting session_key", db, "INSERT INTO system (key, value) VALUES (?, ?)", consts.SystemSessionKey, session.Key)
167 cliDatabase.MustExec(t, "inserting session_key_expiry", db, "INSERT INTO system (key, value) VALUES (?, ?)", consts.SystemSessionKeyExpiry, session.ExpiresAt.Unix())
168}
169
170// apiCreateBook creates a book via the API and returns its UUID
171func apiCreateBook(t *testing.T, env testEnv, user database.User, name, message string) string {

Callers 4

TestSync_EmptyServerFunction · 0.85
setupUserAndLoginFunction · 0.85

Calls

no outgoing calls

Tested by 3

TestSync_EmptyServerFunction · 0.68