Update Readme, fix up auth
This commit is contained in:
parent
423791a373
commit
ada62e95e2
2 changed files with 5 additions and 5 deletions
|
@ -66,7 +66,7 @@ Install steps are for Debian 9 (stretch)
|
|||
|
||||
5. Run the application!
|
||||
```
|
||||
cd ${GOPATH}/src/git.minhas.io/asara/sudoscientist
|
||||
cd ${GOPATH}/src/git.minhas.io/asara/sudoscientist-go-backend
|
||||
for i in settings/*; do source $i; done
|
||||
export DB_HOST=$(docker inspect -f "{{ .NetworkSettings.IPAddress }}" sudosci-db)
|
||||
go get
|
||||
|
|
|
@ -41,8 +41,8 @@ type Claims struct {
|
|||
}
|
||||
|
||||
type JWT struct {
|
||||
JWT string `json:"jwt"`
|
||||
Username string `json:"username"`
|
||||
JWT string `json:"jwt"`
|
||||
Username string `json:"username"`
|
||||
}
|
||||
|
||||
func Init() {
|
||||
|
@ -151,8 +151,8 @@ func signin(w http.ResponseWriter, r *http.Request) {
|
|||
}
|
||||
_, tokenString, _ := TokenAuth.Encode(claims)
|
||||
token := JWT{
|
||||
JWT: tokenString,
|
||||
Username: creds.Username,
|
||||
JWT: tokenString,
|
||||
Username: creds.Username,
|
||||
}
|
||||
render.JSON(w, r, token)
|
||||
}
|
||||
|
|
Reference in a new issue