Commit Graph

21 Commits

Author SHA1 Message Date
d8ea9f79c6 feat: add session expiration tracking and validation
feat: implement Redis caching for terminated sessions
feat: add new session GUID queries for validation
refactor: extend Session model with last_refresh_exp_time
refactor: update token generation to include role and session
refactor: modify auth middleware to validate session status
refactor: replace GetUserSessions with GetValidUserSessions
chore: add uuid/v5 dependency
fix: update router to pass dependencies to auth middleware
chore: update SQL schema and queries for new expiration field
2025-07-14 20:44:30 +03:00
95294686b7 feat: PasswordResetBegin of auth controller;
fix: sql query updateLoginInformationByUsername used in-database hashing;
refactor: renamed LogOutAccounts into LogOutSessions in models/auth;
refactor: added error checks on opening transactions for all auth service methods;
refactor: added error checks on commiting transactions likewise;
refactor: simplified PasswordResetBegin logic;
feat: implemented PasswordResetComplete method of auth service;
2025-07-13 19:10:34 +03:00
65ea47dbb6 feat: new RollbackOnError method added for transactional db helper and integrated into auth service 2025-07-13 15:57:34 +03:00
a2dd8993a6 feat: auth service logic for purging expired unverified accounts upon registration, new sql queries for this purpose 2025-07-13 01:57:19 +03:00
72a512bb4f feat: automatic termination of older sessions on login (temporary until release 4);
fix: login controller method not returning tokens
2025-07-06 14:45:36 +03:00
333817c9e1 refactor: moved hashing logic into application layer for security;
fix: error handling in auth service for database;
refactor: removed redundant taken email check;
chore: removed todos that were completed/not needed;
fix: leaking transactions in complete registration and login on error;
refactor: got rid of txless requests during transactions;
2025-07-06 13:01:08 +03:00
0a51727af8 refactor: updated swagger;
feat: helper function in errors for checking postgres error types;
feat: sql query method for finding users by their email;
feat: registration begin/complete with checking existing username/email;
refactor: error handling in controller
2025-07-03 04:33:25 +03:00
d08db300fc fix: getconfirmationcode query 2025-07-02 14:09:10 +03:00
e2d83aa779 refactor: database update methods use coalesce to omit nil fields 2025-06-27 13:30:03 +03:00
be9aee7145 chore: GPL-3.0 license propagated into *.go files in backend 2025-06-24 01:37:47 +03:00
0a00a5ee2b feat: registrationBegin method without email;
fix: missing sqlc query parameter name;
feat: util for generating security codes;
feat: enums package
2025-06-23 16:23:46 +03:00
ea3743cb04 fixed: error handling in commit;
refactor: exposed untransactional queries for transactional db helper again but with a clearer name this time since it still may be useful
2025-06-22 12:41:22 +03:00
613deae8e2 feat: db regular and transactional helpers to reduce boilerplate 2025-06-21 20:04:20 +03:00
03c072e67b feat: dbcontext implements DBTX interface 2025-06-20 20:32:18 +03:00
8577314875 feat: dbcontext 2025-06-20 20:28:50 +03:00
87878f15a3 feat: service/controller prototype 2025-06-19 18:37:19 +03:00
912470b6e2 refactor: manually renamed password fields 2025-06-19 17:16:41 +03:00
49534d46c1 fix: fixed issue with comments in sqlc-generated go code;
refactor: creating/updating login_information takes plain password and hashes it in database;
feat: db query to get user by their login credentials
2025-06-19 17:10:52 +03:00
8258ac0ad4 feat: all of sql for release 1 2025-06-16 20:30:58 +03:00
c6a6aa6b91 refactor: improved table structure 2025-06-15 10:48:31 +03:00
8aeb6e19d4 feat: got sqlc to work 2025-06-15 01:18:00 +03:00