110 Commits

Author SHA1 Message Date
480655a0ee
refactor(server/middleware): update current user middleware
- check for titlecased version of auth header
- check for token's `sub` field as well as `id`
- ensure we don't select sensitive info when querying the user
- don't throw if there's no user logged in for that request
2024-12-09 15:34:30 -05:00
53409d12da
refactor(api): update session retrieval route
ensure we also check for the titlecased version of `authorization` header
2024-12-08 23:27:47 -05:00
b2c99726bc
fix(api): update login endpoint
remove the `select` call so password validation doesn't fail
2024-11-12 16:39:23 -05:00
1b891c6b2c
fix(api): fix cache location in view counter endpoint 2024-11-11 18:45:49 -05:00
a96f924f1e
fix(api): update view counting endpoint
ensure that an `undefined` ip doesn't get added to the cache store
2024-11-11 18:42:29 -05:00
40bb98eb1d
fix(api): fix replaceOrUpdateContent call not matching the required signature 2024-11-11 17:28:18 -05:00
b782522f33
fix(api): fix replaceOrUpdateContent call not matching the required signature 2024-11-11 17:21:17 -05:00
05d11e0ea5
refactor(api): change stuff in story updating route
if the story doesn't exist/is null, throw
ensure chapter word count is updated (since we weren't already doing that for some reason....)
instead of clearing the original story's chapters and re-adding them one by one, update the existing ones in place, otherwise push to the array
use new signature for `replaceOrUploadContent` call
ensure chapters are sorted
2024-07-09 21:10:03 -04:00
25b7e723f6
refactor(api): actually use doNotSelect filter when querying user at login 2024-07-09 20:36:41 -04:00
0d6acdf174
refactor(workspace): update tsconfig files
enable `esmoduleinterop` and `allowsyntheticdefaultimports`
2024-04-02 01:21:13 -04:00
ce11745bd0
refactor(api): return both refresh and access tokens at login endpoint 2024-03-21 18:35:22 -04:00
4139f6fd58
refactor(api): remove auth cookie checks
just get the authorization header
2024-03-21 18:34:46 -04:00
e88474d406
refactor(api): switch to refresh nuxt-auth provider 2024-03-21 18:26:36 -04:00
bf44122abe
refactor(api): remove some log statements 2024-03-16 21:16:43 -04:00
eb69412fd1
perf(api): tweak cachedEventHandler parameters 2024-03-16 20:58:39 -04:00
7b8a089d95
fix(api): fix story chapter ids disappearing after an edit 2024-03-16 20:03:18 -04:00
f1a5cfffd4
fix(api): fall back to grabbing the current element's _id in replaceOrUploadContent call 2024-03-16 15:43:26 -04:00
07ed91b2a1
fix(api): move replaceOrUploadContent call out of else block 2024-03-16 15:32:58 -04:00
417fda7617
feat(api): add a route to update story views
don't worry, there are duplicate/spam checks in place
2024-01-04 20:49:51 -05:00
da8b960004
refactor(server/plugins): add plugin
use mongodb as unstorage driver
2024-01-04 20:49:03 -05:00
74722ddfd6
fix(api): update story editing route
properly await `replaceOrUpdateContent`
2024-01-04 15:20:25 -05:00
d6c12d5ed8
test(api): create a way to check current working directory 2024-01-03 17:55:06 -05:00
c2ac9e6318
fix(server/middleware): import messages from constants 2023-12-31 14:23:22 -05:00
c795e5d293
feat(api): add dedicated route to fetch user's own stories 2023-12-31 01:48:22 -05:00
f2e40dabf5
fix(build): remove oauth imports
not yet!
2023-12-30 17:36:22 -05:00
088842ac38
refactor(config): change tsconfig
set `verbatimModuleSyntax` to false
2023-12-30 16:58:44 -05:00
cb2f171d86
refactor(api): switch avatar path to assets 2023-12-30 16:35:35 -05:00
3a8fd82dae
fix(api): fix new subscriptions not being saved to database
for some reason i forgot to set the field referenced by $addToSet to `body.push` lmao #justcopyandpastethings
2023-12-30 16:02:27 -05:00
8f45dbe563
style(*): edit indents 2023-12-29 20:53:29 -05:00
c8e84c909e
style(*): cleanup unused imports 2023-12-29 20:11:07 -05:00
1447960b1a
refactor(db/models): update populatedDoc types
- remove `& Document` qualifier
- cast `T | number` to T with the `as` keyword
2023-12-29 19:06:55 -05:00
576684e364
refactor(server/utils): make paths and imports more concise and correct 2023-12-29 16:37:20 -05:00
922807ba6a
refactor(server/utils): make paths and imports more concise and correct 2023-12-29 16:34:00 -05:00
ed4536fa91
chore(api): remove path aliases from tsconfig
in favour of the nuxt aliases
2023-12-28 19:58:59 -05:00
18f11f7ca7
refactor(api): check if coAuthor form field is an empty string
if it is, set coAuthor in document to null, otherwise, set it to the provided value
2023-12-28 19:58:54 -05:00
5b368cf832
refactor(api): change jwt generation call to use new function name 2023-12-28 19:58:26 -05:00
60e564781d
refactor(*): use more sane path aliases 2023-12-28 19:58:26 -05:00
3e5af47107
refactor(*): refactor tsconfig paths
looks/feels nicer
2023-12-20 17:23:31 -05:00
be32464c93
fix(api): fix param name for reviews 2023-12-20 16:42:31 -05:00
50e860df5d
refactor(api): use null propagation for fields in subscription payload 2023-12-11 21:34:20 -05:00
088232f750
refactor(api & server/utils): refactor imports of db helpers
create an index file which exports the functions we need in one accessible place
2023-12-11 21:29:46 -05:00
7f1f8a72f5
refactor(api): get new reply id from save() call 2023-12-09 17:39:28 -05:00
3bc828ad5e
fix(api): allow admins to access a hidden story's full contents 2023-12-09 16:58:35 -05:00
37e9bcc17c
fix(api): fix error not throwing on an illegal access of a full hidden story 2023-12-09 16:56:57 -05:00
ee7ea24e4e
refactor(*): rename route
change "bands" to "band"

BREAKING CHANGE: breaks anything that tries to access `/api/bands/*`
2023-12-06 22:22:48 -05:00
22816477eb
refactor(server/utils): add chapter index parameter to storyCheck function 2023-12-06 22:11:41 -05:00
96a0d36bef
fix(api): update user stories endpoint
it now takes into account the new return type for `listQuerier`
2023-12-06 21:52:04 -05:00
fa27a16e65
fix(api): update review editing endpoint
when checking for whether the requester is the author, treat the author field as an object rather than a number (id)
2023-12-06 21:48:29 -05:00
c9f5d5466d
fix(api): populate user's favourite stories' bands 2023-12-06 21:46:33 -05:00
b5454e9363
feat(api): add endpoint to fetch latest stories 2023-12-06 21:38:30 -05:00