Web client refinement (#16)
* fix(files/handler): add base64 decode for content * fix(singleuser): pick user name from jwt token and encode content * fix(singleuser): add public path check, abstract user info from token * fix(singleuser): update singleuser client * fix(server): fix test and enable auth by default * feat(client/web): add web client * fix(client/web): refine css styles * fix(client/web): refine styles * fix(client/web): refine styles, add test and fix bugs * test(client/web): add web client tests * fix(client/web): refactor client interface and enhance the robustness * chore(client/web): ignore js bundles * test(files): call sync before check Co-authored-by: Jia He <jiah@nvidia.com>
This commit is contained in:
parent
0265baf1b1
commit
ba6a5373d1
53 changed files with 9192 additions and 158 deletions
|
@ -34,19 +34,15 @@ func (cl *SingleUserClient) Login(user, pwd string) (*http.Response, string, []e
|
|||
End()
|
||||
}
|
||||
|
||||
func (cl *SingleUserClient) Logout(user string, token *http.Cookie) (*http.Response, string, []error) {
|
||||
func (cl *SingleUserClient) Logout(token *http.Cookie) (*http.Response, string, []error) {
|
||||
return cl.r.Post(cl.url("/v1/users/logout")).
|
||||
Send(su.LogoutReq{
|
||||
User: user,
|
||||
}).
|
||||
AddCookie(token).
|
||||
End()
|
||||
}
|
||||
|
||||
func (cl *SingleUserClient) SetPwd(user, oldPwd, newPwd string, token *http.Cookie) (*http.Response, string, []error) {
|
||||
func (cl *SingleUserClient) SetPwd(oldPwd, newPwd string, token *http.Cookie) (*http.Response, string, []error) {
|
||||
return cl.r.Patch(cl.url("/v1/users/pwd")).
|
||||
Send(su.SetPwdReq{
|
||||
User: user,
|
||||
OldPwd: oldPwd,
|
||||
NewPwd: newPwd,
|
||||
}).
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue