summaryrefslogtreecommitdiffstats
path: root/modules/generate/generate.go
diff options
context:
space:
mode:
authorJonas Franz <info@jonasfranz.software>2019-03-08 17:42:50 +0100
committertechknowlogick <matti@mdranta.net>2019-03-08 11:42:50 -0500
commite777c6bdc6f12f9152335f8bfd66b956aedc9957 (patch)
treeb79c9bc2d4f9402dcd15d993b088840e2fad8a54 /modules/generate/generate.go
parent9d3732dfd512273992855097bba1e909f098db23 (diff)
downloadgitea-e777c6bdc6f12f9152335f8bfd66b956aedc9957.tar.gz
gitea-e777c6bdc6f12f9152335f8bfd66b956aedc9957.zip
Integrate OAuth2 Provider (#5378)
Diffstat (limited to 'modules/generate/generate.go')
-rw-r--r--modules/generate/generate.go8
1 files changed, 3 insertions, 5 deletions
diff --git a/modules/generate/generate.go b/modules/generate/generate.go
index d0e7593013..304ad87f21 100644
--- a/modules/generate/generate.go
+++ b/modules/generate/generate.go
@@ -57,16 +57,14 @@ func NewInternalToken() (string, error) {
return internalToken, nil
}
-// NewLfsJwtSecret generate a new value intended to be used by LFS_JWT_SECRET.
-func NewLfsJwtSecret() (string, error) {
+// NewJwtSecret generate a new value intended to be used by LFS_JWT_SECRET.
+func NewJwtSecret() (string, error) {
JWTSecretBytes := make([]byte, 32)
_, err := io.ReadFull(rand.Reader, JWTSecretBytes)
if err != nil {
return "", err
}
-
- JWTSecretBase64 := base64.RawURLEncoding.EncodeToString(JWTSecretBytes)
- return JWTSecretBase64, nil
+ return base64.RawURLEncoding.EncodeToString(JWTSecretBytes), nil
}
// NewSecretKey generate a new value intended to be used by SECRET_KEY.