mirror of
https://codeberg.org/davrot/forgejo.git
synced 2025-05-25 21:00:01 +02:00
token recent activity
This commit is contained in:
parent
54b52de6ee
commit
03b85b73af
6 changed files with 24 additions and 8 deletions
|
@ -35,8 +35,8 @@ func NewAccessToken(t *AccessToken) error {
|
|||
return err
|
||||
}
|
||||
|
||||
// GetAccessTokenBySha returns access token by given sha1.
|
||||
func GetAccessTokenBySha(sha string) (*AccessToken, error) {
|
||||
// GetAccessTokenBySHA returns access token by given sha1.
|
||||
func GetAccessTokenBySHA(sha string) (*AccessToken, error) {
|
||||
t := &AccessToken{Sha1: sha}
|
||||
has, err := x.Get(t)
|
||||
if err != nil {
|
||||
|
@ -62,6 +62,12 @@ func ListAccessTokens(uid int64) ([]*AccessToken, error) {
|
|||
return tokens, nil
|
||||
}
|
||||
|
||||
// UpdateAccessToekn updates information of access token.
|
||||
func UpdateAccessToekn(t *AccessToken) error {
|
||||
_, err := x.Id(t.ID).AllCols().Update(t)
|
||||
return err
|
||||
}
|
||||
|
||||
// DeleteAccessTokenByID deletes access token by given ID.
|
||||
func DeleteAccessTokenByID(id int64) error {
|
||||
_, err := x.Id(id).Delete(new(AccessToken))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue