mirror of
https://gitea.com/gitea/tea.git
synced 2026-02-21 22:03:32 +01:00
Require non-empty token in GetLoginByToken (#895)
Fixes: #893 Reviewed-on: https://gitea.com/gitea/tea/pulls/895 Reviewed-by: Lunny Xiao <xiaolunwen@gmail.com> Co-authored-by: Michal Suchanek <msuchanek@suse.de> Co-committed-by: Michal Suchanek <msuchanek@suse.de>
This commit is contained in:
committed by
Lunny Xiao
parent
e644cc49d4
commit
59656dfcd2
@@ -120,6 +120,9 @@ func GetLoginByName(name string) *Login {
|
|||||||
|
|
||||||
// GetLoginByToken get login by token
|
// GetLoginByToken get login by token
|
||||||
func GetLoginByToken(token string) *Login {
|
func GetLoginByToken(token string) *Login {
|
||||||
|
if token == "" {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
err := loadConfig()
|
err := loadConfig()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Fatal(err)
|
log.Fatal(err)
|
||||||
|
|||||||
Reference in New Issue
Block a user