[add] settings (pw & time offset), [fix] PWA issues, [fix] misc styling issues

This commit is contained in:
2023-09-27 18:58:47 -04:00
parent 25ab36e4b5
commit 5a8bdacf4f
16 changed files with 528 additions and 99 deletions

View File

@@ -24,7 +24,7 @@ func (api *API) authorizeCredentials(username string, password string) (authoriz
return false
}
if match, err := argon2.ComparePasswordAndHash(password, user.Pass); err != nil || match != true {
if match, err := argon2.ComparePasswordAndHash(password, *user.Pass); err != nil || match != true {
return false
}
@@ -94,7 +94,6 @@ func (api *API) authFormLogin(c *gin.Context) {
// MD5 - KOSync Compatiblity
password := fmt.Sprintf("%x", md5.Sum([]byte(rawPassword)))
if authorized := api.authorizeCredentials(username, password); authorized != true {
c.HTML(http.StatusUnauthorized, "login", gin.H{
"RegistrationEnabled": api.Config.RegistrationEnabled,
@@ -140,7 +139,7 @@ func (api *API) authFormRegister(c *gin.Context) {
rows, err := api.DB.Queries.CreateUser(api.DB.Ctx, database.CreateUserParams{
ID: username,
Pass: hashedPassword,
Pass: &hashedPassword,
})
// SQL Error