Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[pull] master from go-shiori:master #8

Open
wants to merge 233 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
233 commits
Select commit Hold shift + click to select a range
f1c98a8
Update Dependencies and Replace mattn/go-sqlite with modernc.org/sqli…
n8225 Feb 11, 2022
d569932
fix: remember me session duration (#346)
fmartingr Feb 11, 2022
2dc462b
docs: updated readme docker links
fmartingr Feb 11, 2022
2ca628b
hotfix: fixes session duration from #346
fmartingr Feb 11, 2022
a76b121
fix: golangci-lint errors (#366)
fmartingr Feb 13, 2022
d05d1ad
Setup new CI/CD workflows (#365)
n8225 Feb 13, 2022
fb0bf38
feat: async content download when creating via api (#368)
fmartingr Feb 13, 2022
0bd297d
fix: update bookmark on sqlite database (#367)
fmartingr Feb 13, 2022
2b4fd9f
Remove unneeded alter table transactions from sqlite (#372)
n8225 Feb 14, 2022
3c8a66f
chore: updated readme
fmartingr Feb 14, 2022
feb150f
ci: github action to notify releases via irc
fmartingr Feb 15, 2022
e1e2c7b
Web Server and CI Improvements (#374)
efrecon Feb 19, 2022
560a677
fix: trying to mkdir over an incorrect data path (#378)
fmartingr Feb 23, 2022
b68092c
Heroku buildpack support in go.mod (#388)
diego-mathis Mar 1, 2022
ca3cc11
sqlite: remove unneeded LEFT JOIN to improve performance (#387)
tungel Mar 10, 2022
81d52a2
feat: sqlite migrations (#398)
fmartingr Mar 26, 2022
0fe24d2
fix: url modification when query param is empty (#411)
fmartingr Mar 27, 2022
ce8a172
fix: bookmark content download (#413)
fmartingr Mar 27, 2022
8732fd7
implement migration for mysql & postgres (#422)
hulb May 3, 2022
7394b10
chore: update go dependencies (#424)
fmartingr May 5, 2022
9397832
fix: amd64 build paths (#429)
fmartingr May 26, 2022
2b1ddd0
replace assets generation with embed (#423)
hulb May 26, 2022
0bf1a48
docs: migrate documentation from the wiki (#394)
fmartingr May 26, 2022
f72f050
docs: fixed outdated volume path reference
fmartingr May 26, 2022
3422035
docs: updated pocket import script
fmartingr May 26, 2022
f000f11
Update Usage.md (#435)
jmbmkn Jun 23, 2022
7e1824a
fix invalid assets path when use webroot (#448)
hulb Jul 8, 2022
cba5046
feat: session expire time from backend (#437)
fmartingr Jul 23, 2022
f5652a5
Fix docker migration script example (#451)
kaimoe Jul 23, 2022
0246e10
feat: improve performance for sqlite queries (#425)
Orhideous Aug 8, 2022
c8fec2a
fix: remove manual transaction on sqlite migration 2 (#468)
fmartingr Aug 11, 2022
3deeda7
feat: upgrade to go 1.19 (#469)
fmartingr Aug 11, 2022
39cb642
docs: fix remember represented as a number instead of a bool (#472)
babariviere Sep 30, 2022
09f2465
refactor:pass ctx to db layer, return err instead of recover panic (#…
hulb Sep 30, 2022
4600145
fix(import): check for no rows error (#487)
fmartingr Oct 4, 2022
d15dc18
Update issue templates
fmartingr Oct 8, 2022
821b69d
fix err in keyword searching (#494)
hulb Oct 9, 2022
dc73cd8
fix(psql): save bookmarks not using passed bookmark id for the insert…
fmartingr Oct 9, 2022
d021044
fix: import should respect add_date or last_modified fields (#490)
fmartingr Oct 9, 2022
158c52a
fix: data dir permissions having execute for all (#493)
fmartingr Oct 9, 2022
222fc14
fix: remove CreateNewID usage from api handlers (#486)
fmartingr Oct 9, 2022
040dc5c
fix: failed to save bookmark: context canceled (#499)
Acelya-9028 Oct 11, 2022
05fee53
fix: saving bookmarks inconsistencies (#500)
fmartingr Oct 11, 2022
20b4efa
Added dependabot configuration
fmartingr Oct 11, 2022
4ea81a4
chore(deps): updated go and github actions dependencies (#511)
fmartingr Oct 11, 2022
ed5a3bc
fix: failed to save bookmark: constraint failed: UNIQUE constraint fa…
Acelya-9028 Oct 13, 2022
4de21ea
fix: avoid panic usage when downloading bookmark (#513)
fmartingr Oct 14, 2022
5f1adc6
fix(db): avoid using dash in fts5 queries (#514)
fmartingr Oct 15, 2022
d1f0ce8
fix(api-ext): use same save logic as the api (#518)
fmartingr Oct 15, 2022
c86cf12
fix: remove createnewid usages (#520)
fmartingr Oct 15, 2022
77269b7
feat(frontend): username autofocus on login (#519)
fmartingr Oct 16, 2022
b691abe
Remove typo in post-run command (#527)
AIndoria Oct 28, 2022
00ef531
chore(deps): bump modernc.org/sqlite from 1.19.1 to 1.19.2 (#521)
dependabot[bot] Oct 28, 2022
8efbc94
chore(deps): bump actions/setup-go from 2 to 3 (#522)
dependabot[bot] Oct 28, 2022
23e87f8
chore(deps): bump actions/download-artifact from 2 to 3 (#523)
dependabot[bot] Oct 28, 2022
278b4ce
chore(deps): bump github.com/spf13/cobra from 1.6.0 to 1.6.1 (#528)
dependabot[bot] Nov 4, 2022
9dac4bf
chore(deps): bump modernc.org/sqlite from 1.19.2 to 1.19.3 (#529)
dependabot[bot] Nov 4, 2022
48fb6f6
chore(deps): bump modernc.org/sqlite from 1.19.3 to 1.19.4 (#532)
dependabot[bot] Nov 10, 2022
54fc939
chore(deps): bump github.com/gofrs/uuid (#531)
dependabot[bot] Nov 10, 2022
3fcb295
Make migrations transparent to the user (#530)
fmartingr Nov 27, 2022
27c2fc7
chore(deps): bump modernc.org/sqlite from 1.19.4 to 1.19.5 (#539)
dependabot[bot] Nov 30, 2022
1b03cc4
Reset page when searching for new tag (#550)
ryanwr Jan 10, 2023
e5846ca
chore(deps): bump github.com/go-sql-driver/mysql from 1.6.0 to 1.7.0 …
dependabot[bot] Jan 10, 2023
04a79dc
chore(deps): bump goreleaser/goreleaser-action from 3 to 4 (#544)
dependabot[bot] Jan 10, 2023
3e1d3cd
chore(deps): bump modernc.org/sqlite from 1.19.5 to 1.20.2 (#551)
dependabot[bot] Jan 10, 2023
6b99e19
deps: up to date (#552)
fmartingr Jan 10, 2023
9344bbe
ci: fix goreleaser snapshots (#553)
fmartingr Jan 10, 2023
257506a
feat: improve bookmark image detection (#554)
Katarn Jan 21, 2023
52d9a63
use UTC for cookie expiry date in backend (#566)
MoX46 Feb 5, 2023
47f288f
fix: browser ext cannot archive and update bookmark. (#560)
IvanLi-CN Feb 5, 2023
f6f3faf
deps: update direct deps (#567)
fmartingr Feb 5, 2023
3c1229d
fix(frontend): prevent archive header covering up the archive content…
sdvcrx Feb 22, 2023
888e59d
Add log args for root command (#565)
chain710 Mar 17, 2023
85534b6
Update dependencies (#616)
fmartingr Jun 11, 2023
a4b9250
fix direction in RTL language (#615)
Monirzadeh Jun 11, 2023
dde1b44
fix(log): record user real ip from headers (#603)
Tomilla Jun 11, 2023
98c2d77
thumb image will be not accesable anymore if it is private fix #578 (…
Monirzadeh Jul 2, 2023
8e9324a
deps: update to go 1.20 + dependencies. Fixes CI (#628)
fmartingr Jul 2, 2023
e839b69
fix: goreleaser use go version from go.mod file and fix typo
fmartingr Jul 2, 2023
ec86feb
docs: add matrix link to readme
fmartingr Jul 6, 2023
249f4b8
Initial Ebook Support (#623)
Monirzadeh Jul 9, 2023
6ab6615
fix: prevent bookmark overwrite on download (#636)
fmartingr Jul 9, 2023
e02d3e7
feat: add SHIORI_PG_SSLMODE (#536)
refi64 Jul 9, 2023
78a7578
fix download data image fix #645 (#646)
Monirzadeh Jul 15, 2023
6f19c12
Start working on new REST API. Refactor logic in domains. (#497)
fmartingr Jul 17, 2023
a60dbf3
Run legacy API and new API at the same time. (#648)
fmartingr Jul 19, 2023
454f217
fix: docker buildx tags (#650)
fmartingr Jul 19, 2023
888d053
Allow JWT authentication into legacy APIs (#651)
fmartingr Jul 21, 2023
7776881
fix: workflow delete tags input (#653)
fmartingr Jul 21, 2023
c5c7a5f
Show version in login page (#652)
fmartingr Jul 21, 2023
b70ab19
fix: package-name in cleanup tag (#655)
fmartingr Jul 21, 2023
6c41661
fix: pr tag prune using other action (#656)
fmartingr Jul 21, 2023
622d556
fix: title is never retrieved when adding bookmark (#664)
fmartingr Jul 21, 2023
2cbc592
Show Shiori version on server command (#669)
fmartingr Jul 22, 2023
faa1ae9
chore: remove irc badge from readme (#674)
fmartingr Jul 26, 2023
a60f65f
fix: title overwritten if user has defiend it (#684)
fmartingr Jul 29, 2023
e0d4537
default to sqlite, warn dbms users (#667)
fmartingr Jul 30, 2023
307f293
chore: remove verbose logger (#685)
fmartingr Jul 30, 2023
e5f2de0
Fix CI incorrectly tagging RC releases and disables docker builds on …
fmartingr Jul 30, 2023
2e1016e
preserve fragment in URLs (#315) (#687)
arakimo Aug 5, 2023
8b015a3
Swagger improvements (#666)
fmartingr Aug 12, 2023
f4817cb
fix: Ensure bookmark files are correctly downloaded before deleting c…
Monirzadeh Aug 20, 2023
ef1d18d
fix(db): handle usage of special characters in searches (#721)
fmartingr Sep 11, 2023
1d52569
fix(ci): rc handling
fmartingr Sep 11, 2023
e722cb6
fix: properly parse mysql connection string, docs update (#730)
rutkai Sep 13, 2023
9082f98
deps: upgrade to Go 1.21 (#698)
fmartingr Sep 16, 2023
3fb3f60
just use one dependency for uuid (#736)
Monirzadeh Sep 16, 2023
4df7e1d
feat: build css from less files locally (#735)
fmartingr Sep 16, 2023
9e91029
refactor: Migrate ePub generation to go-epub (#679)
Monirzadeh Sep 16, 2023
36b0121
chore(deps): bump the all group with 6 updates (#738)
dependabot[bot] Sep 22, 2023
a3fb075
chore(deps):Update Github Actions dependencies (#740)
dependabot[bot] Sep 30, 2023
eb666cd
feat: use new JWT auth in all frontend API calls (#743)
fmartingr Sep 30, 2023
2c31048
chore(deps): bump golang dependencies (#746)
dependabot[bot] Oct 3, 2023
c6aabc4
fix: styles-check and swag-check monitor just needed directory not pr…
Monirzadeh Oct 9, 2023
46c1a6a
feat: allow resize the dialogbox for bigger/hidpi screens (#732)
Monirzadeh Oct 9, 2023
c05d617
feat: allow per-user settings and store them in database (#639)
Monirzadeh Oct 15, 2023
106bf16
refactor: remove unneeded variable and unify the way send token in he…
Monirzadeh Oct 17, 2023
f82b97d
add create ebook by default in settings (#761)
Monirzadeh Oct 22, 2023
1ae82f4
fix: Actions in overlays on mobile hard to press (#759)
cbe Oct 22, 2023
03df5e8
fix: allow webp thumbnails (#758)
Monirzadeh Oct 22, 2023
013270a
Update documentation for add links to shiori in android devices from …
Monirzadeh Oct 22, 2023
c64e858
Fix typos (#756)
shirayu Oct 22, 2023
29b1d97
chore(deps): bump the all group with 1 update (#767)
dependabot[bot] Oct 29, 2023
5e9847a
refactor: migrate ebook routes to new http server (#742)
Monirzadeh Oct 29, 2023
f16dd42
Make suggestion clickable in bookmark creation (#765)
cbe Oct 29, 2023
1d58455
chore: comment unused functions
fmartingr Oct 29, 2023
7765e5b
chore: frontend formatting (#764)
cbe Nov 5, 2023
7c4e5fb
ci: add codecov reporting (#776)
fmartingr Nov 12, 2023
9746add
deps: update go dependencies (#777)
fmartingr Nov 12, 2023
d371ee6
fix: typo in URL under documentation (#778)
Monirzadeh Nov 17, 2023
0058209
docs: example deployment for kubernetes (#754)
JPFrancoia Nov 18, 2023
3df4c0b
Add Documentation>CLI>Add bookmark (#794)
LLKoder Dec 9, 2023
188ce68
fix: generate coverage profile (#797)
fmartingr Dec 10, 2023
f01f2db
fix: use noreferer to prevent exposing shiori instance url to archive…
istiak101 Dec 27, 2023
fe6a306
deps: upgrade (#804)
fmartingr Dec 27, 2023
cc7c751
refactor: migrate bookmark static pages to new http server (#775)
fmartingr Dec 28, 2023
cf7301c
Fixed lint errors after refactor (#806)
fmartingr Dec 28, 2023
55ec418
docs: updated configuration page (#808)
fmartingr Dec 29, 2023
7c13626
fix: strict usage of shiori prefix for environment variables in confi…
fmartingr Dec 29, 2023
f72e2de
deps: updated docker image versions (#809)
fmartingr Dec 30, 2023
0c876bc
chore(deps): update ci dependencies (#812)
dependabot[bot] Jan 13, 2024
84e5b09
chore(deps): bump the all group with 3 updates (#815)
dependabot[bot] Jan 16, 2024
15b2a1e
chore(deps): bump the all group with 3 updates (#830)
dependabot[bot] Feb 3, 2024
82aa1e5
fix: fixes path issues on windows (#829)
Monirzadeh Feb 5, 2024
09bc9b4
ci: improved autogenerated changelog on releases by categorizing the …
fmartingr Feb 6, 2024
1ee762a
fix: fix problems that may be raised from a 1.5.5 upgrade (#837)
fmartingr Feb 8, 2024
0368f4e
fix: update go-epub to latest version to avoid filename errors on win…
fmartingr Feb 13, 2024
595cb45
fix: point go-epub go correct repository (#842)
fmartingr Feb 13, 2024
8ba90be
chore(deps): bump the all group with 8 updates (#861)
dependabot[bot] Mar 23, 2024
21c95ac
docs: Add securityContext to provided Kubernetes manifest (#859)
piano1029 Mar 23, 2024
5a16690
fix: use correct endpoint in rename tags operation (#868)
Zlendy Mar 25, 2024
ce04b10
chore: updated github issue template (#672)
fmartingr Mar 27, 2024
9c7483f
fix: override configuration from flags only if set (#865)
fmartingr Mar 30, 2024
47e7259
fix(ci): use correct tag names on version bump (#864)
fmartingr Mar 30, 2024
48db805
fix: remove unfinished endpoints (#877)
fmartingr Apr 7, 2024
ceb392d
fix: use relative path for all API calls (#872)
fmartingr Apr 7, 2024
9175708
chore(deps): bump the all group with 2 updates (#873)
dependabot[bot] Apr 7, 2024
d358b7f
ci: replace deprecated --rm-dist with clean (#878)
Monirzadeh Apr 7, 2024
a281543
chore(deps): bump the all group with 2 updates (#880)
dependabot[bot] Apr 8, 2024
6254f77
fix(ci): prevent tagging docker image as latest on every push (#882)
fmartingr Apr 8, 2024
394d17b
ci: create zip archives for windows builds (#884)
torculus Apr 13, 2024
9bf3dae
docs: add PikaPods managed hosting option (#881)
m3nu Apr 13, 2024
c77a542
fix(ci): renamed deprecated golangci property (#887)
fmartingr Apr 13, 2024
86337a0
deps: update go to 1.22.2 and all dependencies (#889)
fmartingr Apr 13, 2024
db313f5
fix: authentication flow should abort early (#888)
fmartingr Apr 13, 2024
b0ca981
chore(deps): bump codecov/codecov-action in the all group (#890)
dependabot[bot] Apr 20, 2024
b8a3578
feat: api endpoint to serve readable content (#885)
Monirzadeh Apr 20, 2024
31767f7
feat: new migrations system (#876)
fmartingr Apr 27, 2024
59a53fb
chore(deps): bump the all group across 1 directory with 4 updates (#895)
dependabot[bot] Apr 29, 2024
02247b2
refactor: allow specific sqlite engine for OpenBSD (#780)
pacoesteban May 2, 2024
56fdc12
chore(deps): bump the all group across 1 directory with 4 updates (#900)
dependabot[bot] May 3, 2024
c107e97
chore(deps): bump the all group with 4 updates (#902)
dependabot[bot] May 6, 2024
eaa6f0e
fix(sqlite): id column should be unique (#894)
Monirzadeh May 12, 2024
a6e5570
fix: not checking for nil-pointer errors on migrations (#906)
fmartingr May 12, 2024
647945c
ci: unify local and ci docker workflows (#907)
fmartingr May 14, 2024
4de4799
fix: ensure tmp folder is present on docker container (#910)
fmartingr May 15, 2024
e5e1af2
deps: update golang dependencies (#915)
fmartingr May 18, 2024
4e0e23a
chore(deps): bump the all group with 3 updates (#908)
dependabot[bot] May 18, 2024
2d88f90
chore(deps): bump the all group with 2 updates (#917)
dependabot[bot] May 25, 2024
6c94d56
feat: Home button clear search query (#916)
Monirzadeh May 26, 2024
a815003
chore(deps): bump codecov/codecov-action in the all group (#922)
dependabot[bot] May 29, 2024
75395c6
chore: check for avx2 processor feature when trying to run bun (#920)
Monirzadeh May 29, 2024
d05188b
ci: fix codecov action issues (#928)
fmartingr Jun 3, 2024
a1d7579
fix: incorrect original link in archive page (#931)
fmartingr Jun 5, 2024
47a0143
fix: swagger document response type (#932)
Monirzadeh Jun 6, 2024
2a231ec
feat: allow selecting light/dark/follow themes in the webui (#924)
Monirzadeh Jun 6, 2024
650f192
fix: add version to goreleaser archive filename (#934)
fmartingr Jun 8, 2024
72aecd2
feat: new system info panel in webui settings (#926)
fmartingr Jun 8, 2024
9aa8332
fix(ci): ignore nightly tags when comparing stable releases (#935)
fmartingr Jun 8, 2024
bc8c06a
fix: remove ui gap on empty bookmark results (#945)
Monirzadeh Jun 26, 2024
06efb08
fix: always show bookmark menu on tablets (#944)
fmartingr Jun 26, 2024
a3d4a68
feat: use bookmark thumbnail as ebook cover (#943)
Monirzadeh Jun 26, 2024
4a5564d
feat: store created and modified time separately on database for book…
Monirzadeh Jun 26, 2024
e34cd36
fix: add `freebsd` flag to nonCGO build (#947) (#948)
lifepillar Jul 1, 2024
40ae4cd
chore: change warning message for bun on cpus without avx2 (#954)
Monirzadeh Jul 12, 2024
d7a91f7
chore: change public and archive wording to make usage more clear (#958)
Monirzadeh Aug 27, 2024
9a113af
fix: better style for quotes in readable mode (#951)
Monirzadeh Aug 27, 2024
a4304bc
fix: wrong eventBus.js path and non-existant method call (#971)
fmartingr Aug 28, 2024
2bcb890
fix: temporary files not being correctly deleted (#969)
Oppen Aug 28, 2024
027c56d
fix: bookmarks full width while in list mode (#979)
Monirzadeh Sep 22, 2024
9492075
fix: --storage-directory flag not being honored in the CLI (#981)
Monirzadeh Sep 22, 2024
0128107
fix: force a change in thumbnail cache using the modified_at field (#…
Monirzadeh Sep 22, 2024
836b950
chore: bump compose go version to match go.mod (#987)
ishmaelavila Oct 5, 2024
2315f0d
chore(deps): bump the all group across 1 directory with 9 updates (#984)
dependabot[bot] Oct 5, 2024
a3772c3
chore(deps): bump the all group with 3 updates (#990)
dependabot[bot] Oct 12, 2024
8c35a6b
test: add basic e2e tests (#816)
fmartingr Oct 12, 2024
4a58ef0
tests: added tests to the account domain (#993)
fmartingr Nov 1, 2024
6b6d5f3
ci: create alpine images to allow running commands inside the contain…
fmartingr Nov 1, 2024
660d425
docs: add Mac LaunchAgent instructions (#1002)
cdaein Nov 17, 2024
afe49d6
ci: fixed goreleaser latest version binary name breaking buildx (#1019)
fmartingr Dec 8, 2024
bb7bfcc
docs: mkdocs and github pages support (#1018)
fmartingr Dec 8, 2024
617f5dd
fix: documentation update breaking urls in test and readme (#1020)
fmartingr Dec 8, 2024
fb51755
refactor: move login.html into a login component (#1017)
fmartingr Dec 9, 2024
6ccd64f
fix: login component behavior when logging out and refreshing the pag…
fmartingr Dec 9, 2024
7b6fad8
chore(deps): bump the all group with 8 updates (#1021)
dependabot[bot] Dec 10, 2024
4aa0f51
fix: postgresql migration not working with other languages (#1013)
fmartingr Dec 11, 2024
87bc7a8
feat: allow disabling swagger ui and disable it by default (#1026)
fmartingr Dec 11, 2024
c2821ff
feat: allow import of newer pocket data export files in csv format (#…
melnary Dec 11, 2024
ed15f14
chore(deps): bump the go_modules group with 3 updates (#1027)
dependabot[bot] Dec 12, 2024
52154f4
ci: ignore build steps for dependabot (#1033)
fmartingr Dec 21, 2024
a7f2ab6
ci: fix buildx step for dependabots prs
fmartingr Dec 22, 2024
93f21e9
chore(deps): bump actions/setup-go from 5.1.0 to 5.2.0 in the all gro…
dependabot[bot] Dec 22, 2024
306487a
ci: fix alpine latest not being built (#1035)
fmartingr Dec 22, 2024
8be5775
docs(kubernetes): add tmp volume (#1040)
hackeryarn Dec 31, 2024
f23c982
fix: webroot not working in archive view (#1043)
edsu Dec 31, 2024
0b745c1
chore(deps): bump the all group with 2 updates (#1036)
dependabot[bot] Dec 31, 2024
e1e5828
fix: login redirect not working properly after component refactor (#1…
fmartingr Dec 31, 2024
d75de89
fix: use mysql json default as expression (#1048)
fmartingr Jan 1, 2025
45bd4d6
feat: fixes to webroot feature and improvements to development using …
fmartingr Jan 1, 2025
98b6b3f
deps: upgrade golang dependencies (#1047)
fmartingr Jan 2, 2025
c58c355
feat: improve SQLite performance (#1024)
fmartingr Jan 2, 2025
b9db270
fix: incorrectly set cookie's expires value in login.js (#1049)
Promix953 Jan 3, 2025
a9a45cc
test: test all supported engines on their oldest supported releases (…
fmartingr Jan 5, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
fix: remember me session duration (go-shiori#346)
- Default session duration is 1h
- Increased session duration (when remember me is checked) is
  increased to 30d.
  • Loading branch information
fmartingr authored Feb 11, 2022
commit d56993292b37f6e49b1628f58fcdebd79c1313b6
6 changes: 3 additions & 3 deletions internal/view/login.html
Original file line number Diff line number Diff line change
Expand Up @@ -89,22 +89,22 @@

// Send request
this.loading = true;
var sessionAge = this.remember ? 12 : 1;

fetch(new URL("api/login", document.baseURI), {
method: "post",
body: JSON.stringify({
username: this.username,
password: this.password,
remember: sessionAge,
remember: this.remember == 1 ? true : false,
}),
headers: { "Content-Type": "application/json" },
}).then(response => {
if (!response.ok) throw response;
return response.json();
}).then(json => {
// Save session id
var expTime = new Date(Date.now() + sessionAge * 3600 * 1000).toUTCString();
var sessionAge = this.remember == 1 ? 60 * 60 * 24 * 30 : 10
var expTime = new Date(Date.now() + sessionAge * 1000).toUTCString();
document.cookie = `session-id=${json.session}; Path=${new URL(document.baseURI).pathname}; Expires=${expTime}`;

// Save account data
Expand Down
124 changes: 62 additions & 62 deletions internal/webserver/assets-prod.go

Large diffs are not rendered by default.

8 changes: 4 additions & 4 deletions internal/webserver/handler-api.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ func (h *handler) apiLogin(w http.ResponseWriter, r *http.Request, ps httprouter
request := struct {
Username string `json:"username"`
Password string `json:"password"`
Remember int `json:"remember"`
Remember bool `json:"remember"`
Owner bool `json:"owner"`
}{}

Expand Down Expand Up @@ -101,10 +101,10 @@ func (h *handler) apiLogin(w http.ResponseWriter, r *http.Request, ps httprouter

// Calculate expiration time
expTime := time.Hour
if request.Remember > 0 {
expTime = time.Duration(request.Remember) * time.Hour
if request.Remember {
expTime = time.Hour * 24 * 30
} else {
expTime = -1
expTime = time.Second * 10
}

// Create session
Expand Down