Commit Graph

87 Commits

Author SHA1 Message Date
Henry 4558b208ee implement password update flow with reset tokens (fixes #98)
also update AuthFallback database

* re-write fallback auth to use alias or ssbid
* replace Create() with SetPassword() which does an upsert
* Add reset tokens to sqlite
* add test for SetPassword with reset token
2021-05-13 07:39:14 +02:00
Henry 5bfb5316f8 minor fixes
remove unsed about page and fix some typos
2021-05-11 10:17:02 +02:00
Henry 653d0926f7 add password change form 2021-05-11 10:16:35 +02:00
User Cryptix fc5d3e440e add json response for invite facade (fixes #188) 2021-04-23 08:55:50 +02:00
cblgh 2c9fdcb98e update HTML UI to reflect role access restrictions
* disable ui if user is unelevated
* disable revoke button if unelevated and not own invite
* improve styling of disabled elements
* remove revoke if alias not made my current user
2021-04-23 08:33:20 +02:00
cblgh 16985bba8d rewrite list_languages function to use html/template 2021-04-20 11:49:24 +02:00
cblgh c6077337d1 use more robust identifier for test 2021-04-20 10:36:40 +02:00
Alexander Cobleigh a5f7701437 Apply suggestions from code review
Co-authored-by: Henry <111202+cryptix@users.noreply.github.com>

use eh.Handle
2021-04-20 10:36:34 +02:00
cblgh 7759e8f898 add de translation, use []TagTranslation, and sort
to make sure the list of languages is sorted, we now use a slice of
TagTranslation{Tag: string, Translation: string} structs, sorted
by `TagTranslation.Tag`.
2021-04-20 09:22:53 +02:00
cblgh b9fe27b0ca fix inconsistent cookies, set csrf cookie path
while working on the /set-language route, i noticed that i was getting a
csrf error for all /admin views when setting the language, while it
worked well on non-admin routes.

the issue, it turned out, was that we needed to configure gorilla's csrf
feature to set all cookies on the same route. when unconfigured, the
set cookies will only be set for the path they are being set at.

see more in the gorilla.csrf documentation (in particular the csrf.Path
option): https://pkg.go.dev/github.com/gorilla/csrf?utm_source=godoc#Path
2021-04-20 09:22:53 +02:00
cblgh c97b7d44c3 add default language admin ui functionality 2021-04-20 09:22:49 +02:00
cblgh ee185e5f43 don't render language picker if we have less than 2 translations 2021-04-20 09:12:15 +02:00
cblgh 93f84e04b0 redirect with 303 See Other 2021-04-20 09:12:15 +02:00
cblgh f535aa8f9c set & use language cookie 2021-04-20 09:12:13 +02:00
cblgh 9863c6b166 add template func for listing languages 2021-04-20 09:11:41 +02:00
Henry a78c039cc7 reuse urlTo in urlToNotice 2021-04-19 15:00:35 +02:00
Henry 3323a85226 refactor urlTo to use domain information for all links 2021-04-19 15:00:29 +02:00
Andre Staltz bb25283b4c
style the alias page and add JS redirect 2021-04-19 10:07:26 +03:00
Henry 04fb06dcaa add member_is_admin and member_has_role template helpers 2021-04-16 09:40:19 +02:00
Andre Staltz 6b082c45f7
more content and member links on the dashboard 2021-04-15 16:24:57 +03:00
Henry 8ff4adf160 various fixes
* fix test compilation
* fix aliases on member page
* add tests for aliases on member.GetByID and ByFeed
* fix admin tests
* use webassert helper for flash messages
* fix flashes
2021-04-12 14:10:42 +02:00
Henry dbf0fe5801 show login error above form 2021-04-12 14:09:09 +02:00
Henry cec7bc0e44 add flash message helper 2021-04-12 14:09:09 +02:00
Henry da62b1eecc add recovery helper to help with panics in handlers 2021-04-12 14:09:09 +02:00
Henry 81bd94344e web/handlers: revamp error localization
fixes #66
2021-04-12 14:09:07 +02:00
Andre Staltz aee9b7ad69
support /login?ssb-http-auth=1 2021-04-09 13:44:12 +03:00
cblgh 35d1d27c5f deny invite consumption for banned keys 2021-04-07 12:58:03 +02:00
cblgh 1b366dcf9f wip fix tests after new roomdb.RoomConfig interface added 2021-04-06 17:21:41 +02:00
cblgh faae7c0324 get started with privacy modes, parse -mode flag 2021-04-06 16:52:51 +02:00
Andre Staltz 08c8b0cced
style the join (claim invite) pages 2021-03-30 18:04:07 +03:00
Henry d1d108b9b7 Add support for invite consumption via JSON 2021-03-29 15:53:30 +02:00
Henry 921626b829 move NetworkInfo to network package
... and implement MultiserverAddress() there.
2021-03-29 12:29:01 +02:00
Andre Staltz c6397c50d3
support multiserverAddress in start-http-auth URI 2021-03-29 12:34:38 +03:00
Andre Staltz 09fcd573b4 style all the sign-in pages 2021-03-26 18:16:26 +01:00
Henry 7a03e5b479 unify login pages 2021-03-26 13:45:21 +01:00
Henry 3b092885fb cleanup 2021-03-26 13:45:21 +01:00
Henry 4325e0fb3d various fixes
* fill in sid and sc
* fix logout
* cascade member removal
* fix links
* trim suffix from signature
* fix /sse/login link
* fix sse links and filenames
* fix logout
* fix typos
* fix test compilation
* fix bridge test
* correct alias url test
* add some comments
* fix potentiall "can't send" deadlock on bridge

some documentation and license headers
2021-03-26 13:45:17 +01:00
Henry 396961e5e8 implement bridge between muxrcp and http 2021-03-26 13:36:48 +01:00
Henry a180c74c38 begin sign-in with ssb
* sketch session store
* use session store and unify authentication handling
* sketch muxrpc handlers
2021-03-26 13:36:42 +01:00
Henry dde6549f02 rename package web/user to web/members 2021-03-22 15:26:11 +01:00
Henry a0be3e998b various fixes 2021-03-22 13:02:39 +01:00
Henry 36d46a8576 fix denied list in sqlite 2021-03-22 13:02:39 +01:00
Henry 8c48b4a2b8 web/handlers 2021-03-22 13:02:37 +01:00
Henry b9bcbb42ec alias JSON endpoint and testing 2021-03-16 08:49:58 +01:00
Henry 50e4ebbaca aliases: add overview and revoke handlers 2021-03-16 08:49:47 +01:00
Henry 117cad48a7 rename admindb to roomdb 2021-03-10 16:44:46 +01:00
Henry b95c8de8be add room v1 "invite" until we have ssb-uri finalized 2021-03-10 09:35:54 +01:00
Henry fd21dfc60a Various fixes
* fix accept and consumed view
* Apply suggestions from Alex' code review
* define admin.Databases options struct
* structify database parameters of web/handlers
2021-03-10 09:34:36 +01:00
Henry 98468e93a5 Invite endpoints
* Add revoke and created templates
* Render invite accept with domain
* Flesh out accept page
2021-03-10 09:33:55 +01:00
Henry 91dd6017e0 add user.FromContext middleware
A helper package so that handler and render code isnt directly tied to
the authentication package.

Also reduces db lookup overhead to one request to sqlite per request for
the user lookup.
2021-03-10 09:33:27 +01:00