Commit Graph

41 Commits

Author SHA1 Message Date
evazion
3d01febcf7 api keys: require reauthentication when working with API keys.
Require the user to re-enter their password before they can view,
create, update, or delete their API keys.

This works by tracking the timestamp of the user's last password
re-entry in a `last_authenticated_at` session cookie, and redirecting
the user to a password confirmation page if they haven't re-entered
their password in the last hour.

This is modeled after Github's Sudo mode.
2021-02-15 00:17:31 -06:00
evazion
dca53fb0ee /login: fix missing </section> tag. 2021-01-24 21:01:54 -06:00
evazion
ddd149e22b seo: mark login links as nofollow.
Mark links to the login page as rel="nofollow" so that search crawlers
don't constantly try to crawl it. Otherwise the fact the login url is
different on every page (/login?url=<current_url>) confuses crawlers.

Also strip the url param from the canonical url (<link rel="canonical">)
on the login page.
2020-12-27 04:41:49 -06:00
evazion
5625458f69 users: refactor password reset flow.
The old password reset flow:

* User requests a password reset.
* Danbooru generates a password reset nonce.
* Danbooru emails user a password reset confirmation link.
* User follows link to password reset confirmation page.
* The link contains a nonce authenticating the user.
* User confirms password reset.
* Danbooru resets user's password to a random string.
* Danbooru emails user their new password in plaintext.

The new password reset flow:

* User requests a password reset.
* Danbooru emails user a password reset link.
* User follows link to password edit page.
* The link contains a signed_user_id param authenticating the user.
* User changes their own password.
2020-03-08 23:18:15 -05:00
evazion
6a729cf184 sessions/new: fix 'Missing partial static/_secondary_links' error. 2020-02-04 03:45:46 -06:00
evazion
815703a922 views: adjust more <meta> descriptions.
* Add <meta> descriptions to more pages.
* Adjust wiki/pool/forum pages to use an excerpt of the first paragraph.
2020-01-26 19:16:38 -06:00
evazion
6a984de3d5 views: refactor page titles.
Refactor `page_title` helper to automatically include site name.
2020-01-25 01:52:18 -06:00
evazion
872bd28d42 login: move password reset link.
Add "Forgot password?" link next to password field to make it more
obvious.
2019-12-14 15:34:01 -06:00
evazion
48e0569832 login: add /login & /logout routes, rename 'sign in' to 'login'.
* Replace /session/new with /login and /session/sign_out with /logout.
* Rename 'sign in' to 'login'.

This changes are to make urls cleaner and terminology more consistent.
2019-12-14 15:27:13 -06:00
evazion
7f08300f56 login: refactor login form to use simple form.
Also change form to pass params as e.g. `session[name]` instead of just
`name`.
2019-12-14 15:05:54 -06:00
evazion
320ff01e07 login: remove 'remember' checkbox; make session cookies permanent.
Remove the "Remember" checkbox from the login page. Make session cookies
permanent instead. Phase out legacy `user_name` and `password_hash` cookies.

Previously a user's session cookies would be cleared whenever they
closed their browser window, which would log them out of the site. To
work around this, when the "Remember" box was checked on the login page
(which it was by default), the user's name and password hash (!) would
be stored in separate permanent cookies, which would be used to
automatically log the user back in when their session cookies were
cleared. We can avoid all of this just by making the session cookies
themselves permanent.
2019-11-17 17:50:23 -06:00
evazion
31ebfa0a82 css: standardize styling of fineprint text.
Fineprint text was variously styled with `.info`, `.tn`, `.hint`, or
`.cost-footnote` css classes. Standardize on `.fineprint` instead. Use
`.hint` only for form hints and `.tn` only for <tn> tags in translation
notes.

Incidentally changes the font size of form hints to 0.8em (was 0.7em)
and the color of fineprint to #888 (was #AAA or #666).
2019-09-17 00:28:41 -05:00
evazion
a5ef86bbe8 views: add html ids for main menu and subnav menu.
Also refactor secondary links to put the <menu> element in the default
layout instead of in each _secondary_links partial.
2019-09-17 00:28:41 -05:00
evazion
5b468444e7 Tweak signin / signup pages.
* Link to the signup page on the signin page.
* Clarify that emails are optional on the signup page.
2019-09-01 15:54:00 -05:00
evazion
86fa502c71 login page: remove 'sign in securely' link.
This link is unnecessary since Danbooru is now HTTPS-only.
2019-08-25 20:32:25 -05:00
evazion
47e26419d3 nav menu: add html ids to secondary nav menu links (#3844). 2018-08-27 20:57:59 -05:00
Type-kun
a7d553038f Add "disable-with" to most edit forms (should fix #2264) 2016-08-30 22:54:38 +05:00
r888888888
076416c228 fix functional tests 2015-08-19 11:23:29 -07:00
r888888888
cd7aee807e fixes #1018 2013-06-10 18:15:16 -07:00
r888888888
d5f575159f rename references of privileged to gold 2013-04-28 00:04:52 -07:00
小太
1a03a86592 Kill trailing whitespace in erb files 2013-03-19 23:11:58 +11:00
albert
965321a8f4 fixes #427 2013-02-19 14:38:53 -05:00
albert
34ae712be0 fixed titles 2011-10-23 16:55:57 -04:00
albert
d324f4a071 refactored login process, added remember option for login 2011-10-15 16:36:07 -04:00
albert
e011c36ffe fixed tag category coloring, fixed tag category expiration when updating, work on migration 2011-10-10 17:08:29 -04:00
albert
600fe67444 renamed some flavor text 2011-09-28 18:02:41 -04:00
albert
a562d27a5f fixes for mailer config 2011-09-15 18:21:42 -04:00
albert
24bf21540a refactoring views 2011-08-16 18:47:01 -04:00
albert
d6e4283cc7 refactoring 2011-06-12 16:41:23 -04:00
albert
9e287726e3 work 2011-05-29 03:47:06 -04:00
albert
5856b105f5 stuff 2011-03-29 13:56:30 -04:00
albert
9e7efbd295 stubbed in view code from old danbooru; only janitors can lock a wiki page 2011-02-28 14:18:39 -05:00
albert
76a7594a97 implemented favorites on post/show page 2011-02-07 18:57:33 -05:00
albert
c80df378d8 fixed tests 2011-02-02 16:55:36 -05:00
albert
a86b986805 added session controller test 2011-01-28 18:12:09 -05:00
albert
b18f6340e7 renamed sessions to session 2010-12-04 00:51:20 -05:00
albert
cb3d7e9e9b changes 2010-10-08 19:07:47 -04:00
albert
f051e04550 sync 2010-10-08 18:42:26 -04:00
albert
ca8be10ab9 more work on post uploads 2010-03-12 19:27:54 -05:00
albert
9f29ffc8c3 work on post views 2010-03-12 12:32:31 -05:00
albert
15c134b270 work on controllers/views started 2010-03-11 19:42:04 -05:00