103 User *user = NULL; |
103 User *user = NULL; |
104 if(list->defaultauthdb) { |
104 if(list->defaultauthdb) { |
105 char *usr; |
105 char *usr; |
106 char *pw; |
106 char *pw; |
107 if(!basicauth_getuser(sn, rq, &usr, &pw)) { |
107 if(!basicauth_getuser(sn, rq, &usr, &pw)) { |
108 user = list->defaultauthdb->get_user(list->defaultauthdb, usr); |
108 int pwok; |
|
109 user = authdb_get_and_verify(list->defaultauthdb, usr, pw, &pwok); |
109 if(!user) { |
110 if(!user) { |
110 // wrong user name |
111 // wrong user or wrong password |
111 return NULL; |
|
112 } |
|
113 if(!user->verify_password(user, pw)) { |
|
114 // wrong password |
|
115 user->free(user); |
|
116 return NULL; |
112 return NULL; |
117 } |
113 } |
118 // ok - user is authenticated |
114 // ok - user is authenticated |
119 } |
115 } |
120 } |
116 } |