자동 로그인 (#196)

자동 로그인 구현

- login_token 테이블
- reqNonce -> loginByToken
- sha512(token + nonce)

Reviewed-on: https://storage.hided.net/gitea/devsam/core/pulls/196
Co-authored-by: hide_d <hided62@gmail.com>
Co-committed-by: hide_d <hided62@gmail.com>
This commit is contained in:
2021-11-08 04:23:07 +09:00
parent 1472cbf257
commit 673b7054aa
13 changed files with 880 additions and 312 deletions
+17 -2
View File
@@ -58,7 +58,7 @@ CREATE TABLE `member_log` (
INDEX `action` (`member_no`, `action_type`, `date`),
INDEX `member` (`member_no`, `date`)
)
ENGINE=MyISAM DEFAULT CHARSET=utf8mb4;
ENGINE=Aria DEFAULT CHARSET=utf8mb4;
###################
# KV storage
@@ -72,4 +72,19 @@ CREATE TABLE if not exists `storage` (
UNIQUE INDEX `key` (`namespace`, `key`)
)
COLLATE='utf8mb4_general_ci'
ENGINE=MyISAM
ENGINE=Aria;
CREATE TABLE `login_token` (
`id` INT(11) NOT NULL AUTO_INCREMENT,
`user_id` INT(11) NOT NULL,
`base_token` VARCHAR(20) NOT NULL COLLATE 'utf8mb4_general_ci',
`reg_ip` VARCHAR(40) NOT NULL COLLATE 'utf8mb4_general_ci',
`reg_date` DATETIME NOT NULL,
`expire_date` DATETIME NOT NULL,
PRIMARY KEY (`id`),
UNIQUE INDEX `by_token` (`base_token`),
INDEX `by_date` (`user_id`, `expire_date`)
)
COLLATE='utf8mb4_general_ci'
ENGINE=Aria
;