package sysUser

import (
	"context"

	"kami/utility/token"

	"kami/api/sysUser/v1"
)

func (c *ControllerV1) UserLoginOut(ctx context.Context, req *v1.UserLoginOutReq) (res *v1.UserLoginOutRes, err error) {
	userToken, err := token.ParseUserToken(ctx, req.Authorization)
	if err != nil {
		return
	}
	_ = token.DeleteTokenFromRedis(ctx, userToken.UserID)
	return
}
