This commit is contained in:
parent
7eb2b7d00d
commit
6051aaa985
3 changed files with 21 additions and 8 deletions
14
Cargo.lock
generated
14
Cargo.lock
generated
|
@ -158,7 +158,7 @@ checksum = "8c3c1a368f70d6cf7302d78f8f7093da241fb8e8807c05cc9e51a125895a6d5b"
|
|||
[[package]]
|
||||
name = "based"
|
||||
version = "0.1.0"
|
||||
source = "git+https://git.hydrar.de/jmarya/based#cd10c64a1f96703894de9e40a95fd81cc50d244a"
|
||||
source = "git+https://git.hydrar.de/jmarya/based#4e3107ce08aaf6f149880a00707f86f1e94683eb"
|
||||
dependencies = [
|
||||
"bcrypt 0.16.0",
|
||||
"chrono",
|
||||
|
@ -1737,9 +1737,9 @@ dependencies = [
|
|||
|
||||
[[package]]
|
||||
name = "quote"
|
||||
version = "1.0.37"
|
||||
version = "1.0.38"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "b5b9d34b8991d19d98081b46eacdd8eb58c6f2b201139f7c5f643cc155a633af"
|
||||
checksum = "0e4dccaaaf89514f546c693ddc140f729f958c247918a13380cccc6078391acc"
|
||||
dependencies = [
|
||||
"proc-macro2",
|
||||
]
|
||||
|
@ -2071,9 +2071,9 @@ dependencies = [
|
|||
|
||||
[[package]]
|
||||
name = "rustversion"
|
||||
version = "1.0.18"
|
||||
version = "1.0.19"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "0e819f2bc632f285be6d7cd36e25940d45b2391dd6d9b939e79de557f7014248"
|
||||
checksum = "f7c45b9784283f1b2e7fb61b42047c2fd678ef0960d4f6f1eba131594cc369d4"
|
||||
|
||||
[[package]]
|
||||
name = "ryu"
|
||||
|
@ -2552,9 +2552,9 @@ checksum = "13c2bddecc57b384dee18652358fb23172facb8a2c51ccc10d74c157bdea3292"
|
|||
|
||||
[[package]]
|
||||
name = "syn"
|
||||
version = "2.0.91"
|
||||
version = "2.0.92"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "d53cbcb5a243bd33b7858b1d7f4aca2153490815872d86d955d6ea29f743c035"
|
||||
checksum = "70ae51629bf965c5c098cc9e87908a3df5301051a9e087d6f9bef5c9771ed126"
|
||||
dependencies = [
|
||||
"proc-macro2",
|
||||
"quote",
|
||||
|
|
13
migrations/00001_based_update.sql
Normal file
13
migrations/00001_based_update.sql
Normal file
|
@ -0,0 +1,13 @@
|
|||
CREATE TYPE session_kind AS ENUM ('api', 'user');
|
||||
|
||||
ALTER TABLE user_session
|
||||
ADD COLUMN IF NOT EXISTS "created" timestamptz NOT NULL DEFAULT NOW(),
|
||||
ADD COLUMN IF NOT EXISTS "csrf" UUID NOT NULL DEFAULT gen_random_uuid(),
|
||||
ADD COLUMN IF NOT EXISTS "name" VARCHAR(255),
|
||||
ADD COLUMN IF NOT EXISTS kind session_kind NOT NULL DEFAULT 'user';
|
||||
|
||||
CREATE TABLE IF NOT EXISTS user_profile_pic (
|
||||
username VARCHAR(255) NOT NULL PRIMARY KEY,
|
||||
"image" bytea NOT NULL,
|
||||
FOREIGN KEY (username) REFERENCES users(username)
|
||||
);
|
|
@ -1,4 +1,4 @@
|
|||
use based::auth::{User, UserRole};
|
||||
use based::auth::{Sessions, User, UserRole};
|
||||
use based::check_admin;
|
||||
use based::request::api::{api_error, vec_to_api, FallibleApiResponse};
|
||||
use rocket::get;
|
||||
|
|
Loading…
Reference in a new issue