using Butter.Dtos;

namespace MilkStream;

public static class AuthHelpers {
    public static AuthInfo ToAuthInfo(this AuthResultDto authResult) {
        if (authResult == null) {
            throw new ArgumentNullException(nameof(authResult), "AuthResultDto cannot be null");
        }
        
        return new () {
            UserId       = authResult.UserId,
            Token        = authResult.Token,
            RefreshToken = authResult.RefreshToken
        };
    }
}
