diff options
author | techknowlogick <techknowlogick@gitea.io> | 2019-05-04 11:45:34 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-05-04 11:45:34 -0400 |
commit | 46373e765702a203bfcb576c9d3639314ef4965f (patch) | |
tree | a44ba4de8593a9ad7898683e0e6df80e0072ef17 /routers | |
parent | 1fa96629461ac4229932b0a4526fc2f60c88ec51 (diff) | |
download | gitea-46373e765702a203bfcb576c9d3639314ef4965f.tar.gz gitea-46373e765702a203bfcb576c9d3639314ef4965f.zip |
Hash App token (#6724)
Diffstat (limited to 'routers')
-rw-r--r-- | routers/api/v1/user/app.go | 12 | ||||
-rw-r--r-- | routers/user/setting/applications.go | 2 |
2 files changed, 7 insertions, 7 deletions
diff --git a/routers/api/v1/user/app.go b/routers/api/v1/user/app.go index ef53e95d8b..d9716f419a 100644 --- a/routers/api/v1/user/app.go +++ b/routers/api/v1/user/app.go @@ -37,9 +37,9 @@ func ListAccessTokens(ctx *context.APIContext) { apiTokens := make([]*api.AccessToken, len(tokens)) for i := range tokens { apiTokens[i] = &api.AccessToken{ - ID: tokens[i].ID, - Name: tokens[i].Name, - Sha1: tokens[i].Sha1, + ID: tokens[i].ID, + Name: tokens[i].Name, + TokenLastEight: tokens[i].TokenLastEight, } } ctx.JSON(200, &apiTokens) @@ -81,9 +81,9 @@ func CreateAccessToken(ctx *context.APIContext, form api.CreateAccessTokenOption return } ctx.JSON(201, &api.AccessToken{ - Name: t.Name, - Sha1: t.Sha1, - ID: t.ID, + Name: t.Name, + Token: t.Token, + ID: t.ID, }) } diff --git a/routers/user/setting/applications.go b/routers/user/setting/applications.go index 90e34d9e1a..d93684bcc0 100644 --- a/routers/user/setting/applications.go +++ b/routers/user/setting/applications.go @@ -49,7 +49,7 @@ func ApplicationsPost(ctx *context.Context, form auth.NewAccessTokenForm) { } ctx.Flash.Success(ctx.Tr("settings.generate_token_success")) - ctx.Flash.Info(t.Sha1) + ctx.Flash.Info(t.Token) ctx.Redirect(setting.AppSubURL + "/user/settings/applications") } |