17 lines
424 B
Go
17 lines
424 B
Go
package threads_account
|
|
|
|
import (
|
|
"context"
|
|
|
|
"haixun-backend/internal/library/authctx"
|
|
app "haixun-backend/internal/library/errors"
|
|
"haixun-backend/internal/library/errors/code"
|
|
)
|
|
|
|
func actorFrom(ctx context.Context) (tenantID, uid string, err error) {
|
|
actor, ok := authctx.ActorFromContext(ctx)
|
|
if !ok {
|
|
return "", "", app.For(code.Auth).AuthUnauthorized("missing actor")
|
|
}
|
|
return actor.TenantID, actor.UID, nil
|
|
} |