forgejo/models/auth
Gusted 7752ff8baa
[GITEA] Fix session generation for database
- If the session doesn't exist, it shouldn't be expected that the
variable is non-nil. Define the session variable instead and insert that.
- Add unit tests to test the behavior of the database sessions code .
- Regression caused by dd30d9d5c0.
- Resolves https://codeberg.org/forgejo/forgejo/issues/2042

(cherry picked from commit 90307ad200)
(cherry picked from commit 874ef1978d)
(cherry picked from commit 27d5f035fc)
(cherry picked from commit 65dbc4303b)

[GITEA] Fix session generation for database (squash) timeutil.Mock

because of e743570f65 * Refactor timeutil package (#28623)

(cherry picked from commit acc6b51be2)
(cherry picked from commit 02b74317f2)
(cherry picked from commit 63b9b624bd)
2024-01-22 18:13:41 +00:00
..
access_token.go Use db.Find instead of writing methods for every object (#28084) 2023-11-24 03:49:41 +00:00
access_token_scope.go [GITEA] silently ignore obsolete sudo scope 2024-01-22 14:35:03 +00:00
access_token_scope_test.go [GITEA] silently ignore obsolete sudo scope 2024-01-22 14:35:03 +00:00
access_token_test.go Use db.Find instead of writing methods for every object (#28084) 2023-11-24 03:49:41 +00:00
auth_token.go [SECURITY] Rework long-term authentication 2024-01-22 13:41:21 +00:00
main_test.go make writing main test easier (#27270) 2023-09-28 01:38:53 +00:00
oauth2.go Use db.Find instead of writing methods for every object (#28084) 2023-11-24 03:49:41 +00:00
oauth2_list.go Use db.Find instead of writing methods for every object (#28084) 2023-11-24 03:49:41 +00:00
oauth2_test.go Final round of db.DefaultContext refactor (#27587) 2023-10-14 08:37:24 +00:00
session.go Fix session key conflict with database keyword (#28613) 2023-12-27 15:24:23 +08:00
session_test.go [GITEA] Fix session generation for database 2024-01-22 18:13:41 +00:00
source.go [TESTS] oauth2: add integration test helpers 2024-01-22 13:41:20 +00:00
source_test.go Penultimate round of db.DefaultContext refactor (#27414) 2023-10-11 04:24:07 +00:00
twofactor.go [GITEA] Drop sha256-simd in favor of stdlib 2024-01-22 18:13:40 +00:00
webauthn.go Move more functions to db.Find (#28419) 2024-01-15 02:19:25 +00:00
webauthn_test.go Next round of db.DefaultContext refactor (#27089) 2023-09-16 14:39:12 +00:00