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!
|
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
|
for i in settings/*; do source $i; done
|
||||||
export DB_HOST=$(docker inspect -f "{{ .NetworkSettings.IPAddress }}" sudosci-db)
|
export DB_HOST=$(docker inspect -f "{{ .NetworkSettings.IPAddress }}" sudosci-db)
|
||||||
go get
|
go get
|
||||||
|
|
|
@ -41,8 +41,8 @@ type Claims struct {
|
||||||
}
|
}
|
||||||
|
|
||||||
type JWT struct {
|
type JWT struct {
|
||||||
JWT string `json:"jwt"`
|
JWT string `json:"jwt"`
|
||||||
Username string `json:"username"`
|
Username string `json:"username"`
|
||||||
}
|
}
|
||||||
|
|
||||||
func Init() {
|
func Init() {
|
||||||
|
@ -151,8 +151,8 @@ func signin(w http.ResponseWriter, r *http.Request) {
|
||||||
}
|
}
|
||||||
_, tokenString, _ := TokenAuth.Encode(claims)
|
_, tokenString, _ := TokenAuth.Encode(claims)
|
||||||
token := JWT{
|
token := JWT{
|
||||||
JWT: tokenString,
|
JWT: tokenString,
|
||||||
Username: creds.Username,
|
Username: creds.Username,
|
||||||
}
|
}
|
||||||
render.JSON(w, r, token)
|
render.JSON(w, r, token)
|
||||||
}
|
}
|
||||||
|
|
Reference in a new issue