mirror of
https://github.com/navidrome/navidrome.git
synced 2024-09-11 20:12:54 +02:00
16 lines
232 B
Go
16 lines
232 B
Go
package core
|
|
|
|
import (
|
|
"context"
|
|
|
|
"github.com/navidrome/navidrome/model/request"
|
|
)
|
|
|
|
func userName(ctx context.Context) string {
|
|
if user, ok := request.UserFrom(ctx); !ok {
|
|
return "UNKNOWN"
|
|
} else {
|
|
return user.UserName
|
|
}
|
|
}
|