Create cookie-based login and authentication system

This commit is contained in:
Alex Cabal 2022-07-10 18:58:55 -05:00
parent 45221365b5
commit 0bc3dc3830
46 changed files with 528 additions and 195 deletions

View file

@ -1,7 +0,0 @@
CREATE TABLE `ApiKeys` (
`UserId` int(10) unsigned NOT NULL,
`Created` datetime NOT NULL,
`Ended` datetime DEFAULT NULL,
`Notes` text DEFAULT NULL,
KEY `idxUserId` (`UserId`,`Ended`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

View file

@ -0,0 +1,8 @@
CREATE TABLE `Benefits` (
`UserId` int(10) unsigned NOT NULL,
`CanAccessFeeds` tinyint(1) unsigned NOT NULL,
`CanVote` tinyint(1) unsigned NOT NULL,
`CanBulkDownload` tinyint(1) unsigned NOT NULL,
PRIMARY KEY (`UserId`),
KEY `idxBenefits` (`CanAccessFeeds`,`CanVote`,`CanBulkDownload`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

View file

@ -0,0 +1,7 @@
CREATE TABLE `Sessions` (
`UserId` int(10) unsigned NOT NULL,
`Created` datetime NOT NULL,
`SessionId` char(36) NOT NULL,
KEY `idxUserId` (`UserId`),
KEY `idxSessionId` (`SessionId`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;