added totp support

This commit is contained in:
ston1th 2018-10-27 16:05:17 +02:00
commit bac08dc7cf
16 changed files with 448 additions and 32 deletions

View file

@ -24,11 +24,6 @@ var routes = []route{
staticHandler,
[]string{"GET"},
},
{
"/login",
loginHandler,
[]string{"GET", "POST"},
},
{
"/search",
searchHandler,
@ -45,6 +40,17 @@ var routes = []route{
allHandler,
[]string{"GET"},
},
{
"/login",
loginHandler,
[]string{"GET", "POST"},
},
{
"/totp",
totpAuthHandler(
loginTotpHandler),
[]string{"GET", "POST"},
},
{
"/blacklist",
authHandler(
@ -81,6 +87,12 @@ var routes = []route{
userEditHandler),
[]string{"GET", "POST"},
},
{
"/user/totp/{user:[a-zA-Z0-9]+$}",
userAuthHandler(
userTotpHandler),
[]string{"GET", "POST"},
},
{
"/logout",
logoutHandler,